公共控件大同小異,只簡單介紹下,具體內容可隨時查閱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.