ddx_cbstring_ddr和ddx_东方财富ddx抓涨停(21)

电脑杂谈  发布时间:2017-03-01 20:06:45  来源:网络整理

}

3.6 MFC中所提供的各种视类介绍

MFC中提供了丰富的视类供开发者使用,下面对各个类进行介绍:

CView类是最基本的视类只支持最基本的操作。

CScrollView类提供了滚动的功能,你可以利用void CScrollView::SetScrollSizes( int nMapMode, SIZE sizeTotal, const SIZE& sizePage = sizeDefault, const SIZE& sizeLine = sizeDefault )设置滚动尺寸,和坐标映射模式。但是在绘图和接收用户输入时需要对坐标进行转换。请参见3.2 接收用户输入。

CFormView类提供用户在资源文件中定义界面的能力,并可以将子窗口和变量进行绑定。通过UpdateData函数让数据在变量和子窗口间交换。

CTreeView类利用TreeCtrl界面作为视界面,通过调用CTreeCtrl&

CTreeView::GetTreeCtrl( ) const得到CTreeCtrl的引用。

CListView类利用ListCtrl界面作为视界面,通过调用CTreeCtrl&

CTreeView::GetTreeCtrl( ) const得到CListCtrl的引用。

CEditView类利用Edit接收用户输入,它具有输入框的一切功能。通过调用CEdit& CEditView::GetEditCtrl( ) const得到Edit&的引用。void

CEditView::SetPrinterFont( CFont* pFont )可以设置打印字体。

4.1 Button

按钮窗口(控件)在MFC中使用CButton表示,CButton包含了三种样式的按钮,Push Button,Check Box,Radio Box。所以在利用CButton对象生成按钮窗口时需要指明按钮的风格。 创建按钮:BOOL CButton::Create( LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );其中lpszCaption是按钮上显示的文字,dwStyle为按钮风格,除了Windows风格可以使用外(如WS_CHILD|WS_VISUBLE|WS_BORDER)还有按钮专用的一些风格。

? BS_AUTOCHECKBOX 检查框,按钮的状态会自动改变 Same as a check box, except

that a check mark appears in the check box when the user selects the box; the check mark disappears the next time the user selects the box.

? BS_AUTORADIOBUTTON 圆形选择按钮,按钮的状态会自动改变 Same as a radio

button, except that when the user selects it, the button automatically

highlights itself and removes the selection from any other radio buttons with the same style in the same group.

? BS_AUTO3STATE 允许按钮有三种状态即:选中,未选中,未定 Same as a


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-35251-21.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...