i want to display CMyDialog dialog with some button disabled (or hidden or with caption changed ...)
i try this but didn't work
CMyDialog t;
t.GetDlgItem(IDC_MY_BUTTON)->EnableWindow(FALSE);
t.DoModal();
CDialog is just a wrapper representing a dialog window. The window and its controls arent created just because you instantiate a CDialog, they get created in the DoModal call.
They do exist when you're handling the INITDIALOG message.
In other words, adjust the dialog's OnInitDialog method to do your enabling stuff.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.