How to Make a GUI with Commands?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
LanceDaoust
Posts: 9
Joined: 06 Jan 2017, 14:14
Location: Canada
Contact:

How to Make a GUI with Commands?

06 Jan 2017, 14:19

Hi guys

I would like to create a GUI that has 4 actions in it, but so far I can only get it to send text.

I want the user to click on each option and then instantly the GUI closes and does an action, such as launch an App, or Run, or FileCopy.

Any help would be appreciated.
Thanks!
THIS IS ME: :wtf:
Tup
Posts: 62
Joined: 25 Jun 2015, 13:10

Re: How to Make a GUI with Commands?

06 Jan 2017, 15:00

Create buttons for each option/task you need for your GUI.
Add a g-label to each button.
In the g-label subroutine set the things you want to be executed.
That's about it, I guess.
Everything is explained very well in the documentation.
https://autohotkey.com/docs/commands/index.htm
Succes

Tup
User avatar
LanceDaoust
Posts: 9
Joined: 06 Jan 2017, 14:14
Location: Canada
Contact:

Re: How to Make a GUI with Commands?

06 Jan 2017, 15:04

Tup wrote:Create buttons for each option/task you need for your GUI.
Add a g-label to each button.
In the g-label subroutine set the things you want to be executed.
That's about it, I guess.
Everything is explained very well in the documentation.
https://autohotkey.com/docs/commands/index.htm
Succes

Tup
Thanks for that, it puts me in a different direction than I was on. If I had an example of how to create a button and its subroutine I would be able to keep going; I am not good without examples. Could you show me a mock-up, or point me to one, please?
THIS IS ME: :wtf:
User avatar
LanceDaoust
Posts: 9
Joined: 06 Jan 2017, 14:14
Location: Canada
Contact:

Re: How to Make a GUI with Commands?

06 Jan 2017, 15:11

Here's an example of what I think you're talking about. I will customize this now:

Code: Select all

F19::
	gui, add, button, x5 y5 h20 w70 gsub1, Subroutine 1 ;these buttons use g-labels to define a subroutine to act on.
	gui, add, button, x5 y30 h20 w70 gsub2, Subroutine 2
	gui, show, w80
	return

	sub1: ;when creating the subroutine remember to leave off the g.
	 {
	   msgbox, You clicked the first button!
	 }
	return

	sub2:
	 {
	   msgbox, You clicked the Second button!
	 }
	return

return
THIS IS ME: :wtf:
Tup
Posts: 62
Joined: 25 Jun 2015, 13:10

Re: How to Make a GUI with Commands?

06 Jan 2017, 15:30

Is this what you needed?
(your smiley stills look a little puzzled)
Need more help?
User avatar
LanceDaoust
Posts: 9
Joined: 06 Jan 2017, 14:14
Location: Canada
Contact:

Re: How to Make a GUI with Commands?

06 Jan 2017, 15:33

Tup wrote:Is this what you needed?
(your smiley stills look a little puzzled)
Need more help?
Actually, you put me on the right track! I have made much more progress with your method than what I was working with before. The confused smiley is my signature, lol
THIS IS ME: :wtf:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: DaveF, Rohwedder and 138 guests