default buttons
-
Hello, I have a dialog with an OK and Cancel button, for example. Until a certain event takes place, the OK button is disabled, and the Cancel button is default (ie: has the thicker black outline). When the event takes place, and the OK button becomes enabled, I want it so that the OK button instantly becomes the only default button. With what keywords can I accomplish this? Thanks ;)
-
Hello, I have a dialog with an OK and Cancel button, for example. Until a certain event takes place, the OK button is disabled, and the Cancel button is default (ie: has the thicker black outline). When the event takes place, and the OK button becomes enabled, I want it so that the OK button instantly becomes the only default button. With what keywords can I accomplish this? Thanks ;)
use
[CDialog::SetDefID()](http://msdn2.microsoft.com/en-us/library/7sd15kw3.aspx)[[^](http://msdn2.microsoft.com/en-us/library/7sd15kw3.aspx "New Window")]
for instance :this->SetDefID(IDOK); //considering that this is your dialog box class
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
-
use
[CDialog::SetDefID()](http://msdn2.microsoft.com/en-us/library/7sd15kw3.aspx)[[^](http://msdn2.microsoft.com/en-us/library/7sd15kw3.aspx "New Window")]
for instance :this->SetDefID(IDOK); //considering that this is your dialog box class
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
-
the
this
is the pointer within the CDialog class in which the processing event were caught. i mean, if you're switching the default button when typing something in an edit box for instance, you override the EN_CHANGE message of that edit box, and as this editbox belongs to the dialogbox, thethis
pointer refers to the dialog box. have you even copied the code to try it ?
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
-
aafcls wrote:
can you please be more specific, I'm not sure how you mean to implement this.
Just call
SetDefID(IDOK)
. It's not any harder than that.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb