英文:
Create a GUI with clickable buttons
问题
#m::
Gui, Show, w200 h200, 弹出窗口标题
Gui, Add, Button, default, 1
Gui, Add, Button, default, 2
Gui, Add, Button, default, 2
Return
但我现在想知道,如何为这些按钮添加功能。如果我按下数字,我想前往特定的网站,例如按下1时前往http://www.nu.nl。
您有关于如何让这个代码工作的建议吗?
英文:
I have created the following code that triggers a pop screen with some buttons
#m::
Gui, Show, w200 h200, Window title
Gui, Add, Button, default, 1
Gui, Add, Button, default, 2
Gui, Add, Button, default, 2
Return
I would like to add now however what I should do to add a function for these buttons. I would like to go to particular websites if I enter then number. So for example to http>//www,nu.nl if I press 1.
Any advice on how I get this working?
答案1
得分: 1
尝试类似以下的代码:
#SingleInstance Force
#UseHook
Gui, +AlwaysOnTop +Resize
Gui, add, Button, x5 y10 w250 h20 g1, 1 --> autohotkey questions - Stack Overflow
Gui, add, Button, x5 y30 w250 h20 g2, 2 --> windows-10 questions - Stack Overflow
Gui, add, Button, x5 y50 w250 h20 g3, 3 --> command-line questions - Stack Overflow
return
#m:: Gui, show, x0 y0 w280 h200 NoActivate, Websites
1:: Run https://stackoverflow.com/questions/tagged/autohotkey
2:: Run https://stackoverflow.com/questions/tagged/windows-10
3:: Run https://stackoverflow.com/questions/tagged/command-line
GuiClose:
ExitApp
请注意,我只翻译了代码部分,没有翻译其他内容。
英文:
Try something like this:
#SingleInstance Force
#UseHook
Gui, +AlwaysOnTop +Resize
Gui, add, Button, x5 y10 w250 h20 g1, 1 --> autohotkey questions - Stack Overflow
Gui, add, Button, x5 y30 w250 h20 g2, 2 --> windows-10 questions - Stack Overflow
Gui, add, Button, x5 y50 w250 h20 g3, 3 --> command-line questions - Stack Overflow
return
#m:: Gui, show, x0 y0 w280 h200 NoActivate, Websites
1:: Run https://stackoverflow.com/questions/tagged/autohotkey
2:: Run https://stackoverflow.com/questions/tagged/windows-10
3:: Run https://stackoverflow.com/questions/tagged/command-line
GuiClose:
ExitApp
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论