...类CDrawButton) ·把按键的标题显示出来 这个实现起来比较简单,我们可以重载CButton类的成员函数DrawItem(), void CDrawButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct){CDC dc;CRect rect=lpDrawItemStruct->rcItem;//得到按键区域CString sCaption;dc.Attach(...
...明。第三种:把button按钮属性设置为ower draw然后映射onDrawItem消息在ondraw函数内自己绘制就可以了void CUi6Dlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct) {if(nIDCtl == IDC_HELLO_CFAN){//绘制按钮框架UINT uStyle = DFCS_BUTTONPUSH;//是否按下去了?if (...
...30;ÖÆ¾Í¿ÉÒÔÁËvoid CUi6Dlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCTlpDrawItemStruct){if(nIDCtl == IDC_HELLO_CFAN){//»æÖư´Å¥...
...tual function overrides//{{AFX_VIRTUAL(CSXBtn)//}}AFX_VIRTUAL // Implementationpublic:void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);virtual ~CSXBtn(); // Generated message map functionsprotected://{{AFX_MSG(CSXBtn...
...Wizard generated virtual function overrides//{{AFX_VIRTUAL(CBaseButton)public:virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);virtual BOOL PreTranslateMessage(MSG* pMsg);//}}AFX_VIRTUAL // Implementationpubl...
...demonstrates how I did this in the STATUS sample:case WM_DRAWITEM:if ((int)wParam == ID_STATUSBAR) {LPDRAWITEMSTRUCT lpDis;HDC hdcMem;HBITMAP hbmOld;BITMAP bm; // Save the drawing information. This information is spe...
...重载CMenu类的DrawItem()函数来实现的,这个函数根据各种菜单状态,处理当前菜单项中菜单图标、文字显示的功能。DrawItem()函数的原形为:virtual void DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct ),它参数为一个指向DRAWITEMSTRUCT结构的指针,DRAWITEMSTRUCT结构如下: typedef struct tagDRAWITEMSTRUCT...
...把button按钮属性设置为ower draw 然后映射onDrawItem消息 在ondraw函数内自己绘制就可以了 void CUi6Dlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct) { if(nIDCtl == IDC_HELLO_CFAN) { //绘制按钮框架 UINT uStyle = DFCS_BUTTONPUSH; //...
...tusBar {... #if _MFC_VER < 0x400 virtual void DoPaint(CDC* pDC); #else virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); #endif ...} //BitmapStatusBar.cpp #if _MFC_VER < 0x400 void CBitmapS...