Hello, all!
Ther question is:
How can I get a modal dialog not to close after the <Enter>-Key is pressed over it?
There is probably such a feature of the dialog but I cannot find out what it is.
Select the "Ok" button and look in properties. There should be some property like "Default" or "Defaule Button" or something like that. Set this property to false or if there is a check box(on older versions) untick that.
BUT the point is: I have a modal dialog, that has some tabs. Each tab is a separate dialog (I mean like PropertySheet, but the VC++ variant)
And being in any of the tabs I need to get rid of that "Default Button"-feature (it's style name is
Code:
BS_DEFPUSHBUTTON
).
I can get to the parent Window and then to the button, all OK. In the OnInitDialog function I check if "OK"-button has the style
Code:
BS_DEFPUSHBUTTON
and get rid of it. If I now get the style of the button - it has no
Code:
BS_DEFPUSHBUTTON
. All OK. But if the window is redrawn (e.g. it is covered by another window and then aktivated again) the
You sure have done some unusual things. I had ho problems with that. Maybe when you reactivate window, the button take the focus and when you press enter it is executed. In this case you should set tabstob to false. But you should see in your application what is up. Also see testing situations
look at the difference between
if(isDefault == false)
and
if(isDefault = false)
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.