I am writing a program using VC++ with MFC,
I added some dialog boxes and I want that once one of the dialog is opened by DoModal()
all the buttons on the parent dialog will be disabled,
How can I do it?
What's the point in that? DoModal will prevent the user from accessing all other windows anyway.
Sometimes it looks nice
With GetWindow you can enumerate all the children of the dialog, and with IsKindOf you can check if the childwindow is a CButton and en/disable it. With these 2 you can make a loop that loops all the elements on a dialog and set the buttonstate.
I agree with GCDEF. It's more user-friendly to let an application behave as most other applications do. Otherwise, it's just confusing. Users may think there is something wrong with the application just because a button is disabled when they didn't expect it.
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky