Thanks, works great.
[This message has been edited by Brent Boshart (edited January 26, 2000).]
Announcement
Collapse
No announcement yet.
Default Button
Collapse
X
-
Lance --
you are right (about space & enter).
Thanks for useful information [smile]
Leave a comment:
-
%BS_DEFAULT is the same as %BS_DEFPUSHBUTTON. The button with this style is "pressed" when the ENTER key is pressed, even if FOCUS in on another control. Therefore, Semen, changing focus does not change the default button for the ENTER key (it does affect the action of the SPACE key).
CONTROL SET FOCUS is a generic function designed to work with all [DDT] controls, so it does not update the appearance of buttons when focus is set. Try this small substitute sub to change focus and default button at the same time:
Code:SUB ButtonSetFocus(BYVAL hDlg AS LONG, BYVAL CtlId AS LONG) CONTROL SET FOCUS hDlg, CtlId CONTROL SEND hDlg, CtlId, %BM_SETSTYLE, %BS_DEFPUSHBUTTON, %TRUE END SUB
Code:CONTROL SEND hDlg, CtlId, %BM_SETSTYLE, %BS_PUSHBUTTON, %TRUE
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Leave a comment:
-
Brent --
"Default" means that a button has a focus. To move focus use
Control Set Focus hDlg&, Id&
Leave a comment:
-
And after the controls are created using DDT, how would I change which button is default? Thats what I'm really after, sorry I should have explained myself better.
[This message has been edited by Brent Boshart (edited January 26, 2000).]
Leave a comment:
-
When you create the selected button use the %BS_DEFAULT style
in the window style. If using DDT as follows :
Code:Control Add Button, FindDlg, %btnSearch, "Find", 15, 95, 45, 12,%BS_DEFAULT,
Leave a comment:
-
Default Button
Sorry, very basic question but can't find answer - how do I set the default button then will be activated if the enter key is pressed.Tags: None
Leave a comment: