Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaing modal dialog

Status
Not open for further replies.

albertnik

Programmer
Joined
Jan 14, 2006
Messages
4
Location
GR
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.

/Per

www.perfnurt.se
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top