dynamic DefPushButton
-
I have a modal dialog with an OK button with BS_DEFPUSHBUTTON style but when the focus is on a particular textbox, I want to change the DefPushButton to another one, so when the user press ENTER the action is related to that field. I tried to redefine it using SetButtonStyle(), but it doesn't work. The button visually seems to receive the Default focus, but whem I press ENTER the old default one is clicked. If I take the DEF style from the old one, then no action happens when I press ENTER. Then, a strange thing happens with the focus when I tab into the button. When I move the focus to the button with the tab key, it seems like it receives the focus (dotted rectangle inside) but is not in selected state. Is it possible ? Can I change the default button dynamically or windows prevent it ? How can I accomplish such a thing ? Thanks.
-
I have a modal dialog with an OK button with BS_DEFPUSHBUTTON style but when the focus is on a particular textbox, I want to change the DefPushButton to another one, so when the user press ENTER the action is related to that field. I tried to redefine it using SetButtonStyle(), but it doesn't work. The button visually seems to receive the Default focus, but whem I press ENTER the old default one is clicked. If I take the DEF style from the old one, then no action happens when I press ENTER. Then, a strange thing happens with the focus when I tab into the button. When I move the focus to the button with the tab key, it seems like it receives the focus (dotted rectangle inside) but is not in selected state. Is it possible ? Can I change the default button dynamically or windows prevent it ? How can I accomplish such a thing ? Thanks.
Have you looked at the
DM_SETDEFID
message?
A rich person is not the one who has the most, but the one that needs the least.
-
Have you looked at the
DM_SETDEFID
message?
A rich person is not the one who has the most, but the one that needs the least.
Ok, David, that's it. I didn't know this message. I will give it a try. Thanks a lot for pointing me in the right direction.