Thursday, February 19, 2009

AHK - Submit GUI with {Enter}

This is an example of how you can use a hidden button control with the Default option set in order to submit a gui simply by pressing enter.
Gui, Add, Edit, vMyEdit
; Setting x and y prevents the button from changing the size
; of the GUI window when using autosize

Gui, Add, Button, Default Hidden x0 y0 gSubmit
Gui, Show, AutoSize
Return

Submit:
Gui, Submit
MsgBox Value in MyEdit was %MyEdit%
ExitApp


Forum Post

No comments: