公共控件大同小异,只简单介绍下,具体内容可随时查阅MSDN。
目前只记录如何使用,不探究原理。
之后再从如何使用的角度,去深入研究如何实现。
滑块:
MFC类:CSliderCtrl。
MSDN描述:Provides the functionality of the Windows common slider control. 此类用于提供windows公共控件滑块。
常用方法:
SetRangeMin(int);
SetRangeMax(int);SetPos(int);
GetPos(void);
详见MSDN
标签
MFC类:CTabCtrl 。
MSDN描述:Provides the functionality of the Windows common tab control.此类用于提供windows公共控件标签。
常用方法:
InsertItem(int nItem, TCITEM* pTabCtrlItem);
相关结构:TCITEM。
原型:
typedef struct tagTCITEMW
{
UINT mask;
#if (_WIN32_IE >= 0x0300)
DWORD dwState;
DWORD dwStateMask;
#else
UINT lpReserved1;
UINT lpReserved2;
#endif
LPWSTR pszText;
int cchTextMax;
int iImage;
LPARAM lParam;
} TCITEMW, *LPTCITEMW;
msak表示要设置的属性。
树形控件
MFC类:CTreeCtrl
MSDN描述:Provides the functionality of the Windows common tree view control.
列表控件
MFC类:CListCtrl
MSDN描述:
Encapsulates the functionality of a "list view control," which displays a collection of items each consisting of an icon (from an image list) and a label.