使用单选按钮和GUI

时间:2013-09-21 14:16:21

标签: user-interface radio-button autohotkey

我一直在学习使用Autohotkey的GUI,我正在创建一个小脚本,所以当我按下插入按钮时,它允许我快速搜索Google。我无法弄清楚如何使用Radio Buttons,所以比方说,我可以选择搜索Google或Bing。我不知道“如果选择了Google,请在Google上搜索查询”的任何代码。

^Insert::
MsgBox,4,, Would you like to reload?, 3

IfMsgBox, no
Return
IfMsgBox, Timeout
Return
Reload

Insert::
Gui, Add, Text,, Search Google:
Gui, Add, Edit, vSearchQuery ym  ; 
Gui, Add, Button, default, Search  
Gui, Show,, Quick Search
return


GuiClose:
ButtonSearch:
Gui, Submit  
Run, http://www.google.com/search?hl=en&q=%searchQuery% 
Reload

1 个答案:

答案 0 :(得分:0)

这是一个简单的例子:

Gui Add, Radio, vEngine, Google
Gui Add, Radio,, Bing
Gui Add, Button, h25 w126 Default,OK
Gui Show
Return

ButtonOK:
Gui Submit
if Engine = 1
    msgbox % "You chose Google!"    
else if Engine = 2
    msgbox % "You chose Bing!"
ExitApp
相关问题