对啊,自己绘制的和系统带的不是一样么,关键是ID要写正确了,需要类型转换吧,虽然CDialog就派生于CWnd,但是返回类型是CWnd*, 下边是 MSDN中说的 CWnd::GetDlgItem This method retrieves a pointer to the specified control or child window in a dialog box or other window. The pointer returned is usually cast to the type of control identified by nID. CWnd* GetDlgItem ( int nID ) const; void CWnd::GetDlgItem( int nID, HWND* phWnd ) const;
================
应该可以变灰的啊,一般变灰都是这样写
----------------------------------------
把ID该一下,估计是ID的问题,比如IDC_BUTTON_TEST,再试试~
对啊,自己绘制的和系统带的不是一样么,关键是ID要写正确了,需要类型转换吧,虽然CDialog就派生于CWnd,但是返回类型是CWnd*,
下边是 MSDN中说的
CWnd::GetDlgItem
This method retrieves a pointer to the specified control or child window in a dialog box or other window. The pointer returned is usually cast to the type of control identified by nID. CWnd* GetDlgItem (
int nID )
const; void CWnd::GetDlgItem(
int nID,
HWND* phWnd )
const;