Article ID: 108896
Article Last Modified on 11/21/2006
...
public:
CButton m_button;
...
...
protected:
virtual void DoDataExchange(CDataExchange* pDX);
...
void CMyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_BUTTON1, m_button);
}
NOTE: If you use Class Wizard to add a member variable in your dialog
box class, it does this for you.
CMyDlg::OnInitDialog()
{
...
m_button.EnableWindow(FALSE);
...
}
An alternative method is to use the CWnd::GetDlgItem() function to get a
CWnd * to the control and then call EnableWindow(). For example:
CMyDlg::OnInitDialog()
{
...
GetDlgItem(IDC_BUTTON)->EnableWindow(FALSE);
...
}
Additional query words: kbSweptVC600 kbinf 1.00 1.50 2.00 2.10 2.50 2.51 2.52 3.00 3.10 4.00
Keywords: kbhowto kbuidesign kbdlg kbctrl KB108896