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 strongm 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
Jan 14, 2006
4
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
[sub]
www.perfnurt.se[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top