【发布时间】:2012-11-06 02:15:57
【问题描述】:
我正在使用 AutoHotkey GUI + ListBox 从各种选项中选择一个选项,但我无法找到一种方法来让 RETURN 键关闭 GUI,而无需创建带有关联 ButtonOk 事件的附加默认按钮。这是我使用默认按钮的代码:
Gui, +LastFound +AlwaysOnTop -Caption
Gui, Add, ListBox, vMyListBox gMyListBox w300 r10
Gui, Add, Button, Default, OK
GuiControl,, MyListBox, Option 1
GuiControl,, MyListBox, Option 2
GuiControl,, MyListBox, Option 3
Gui, Show
return
MyListBox:
if A_GuiEvent <> DoubleClick
return
ButtonOK:
GuiControlGet, MyListBox
Gui Hide
MsgBox %MyListBox% selected!
ExitApp
GuiClose:
GuiEscape:
ExitApp
【问题讨论】:
标签: autohotkey