Set variables in a GUI.

Get help with using AutoHotkey and its commands and hotkeys
codude
Posts: 101
Joined: 12 Nov 2015, 05:33

Set variables in a GUI.

21 Sep 2018, 16:43

I have some script that I run that has 3 variables. StartValue, EndValue and LocationValue. I usually go in and edit the script to change the values of all 3 of these variables. I stumbled across “Input” values that looks like it would do the job better but now I have seen information on GUI’s. I’m thinking this would be even better yet because I could keep the GUI screen on the window as to what my current values are and then it would be easier to reset the new values for the next time I run a script. I would like to put a button on the GUI to set the values after the 3 new values are entered. I’m finding a lot of samples in these forums that I can make work but they are much more elaborate than what I need to do and when I try to trim them down I’m doing something wrong and everything stops working.
buttshark
Posts: 62
Joined: 22 Apr 2017, 20:57

Re: Set variables in a GUI.

22 Sep 2018, 03:15

So, what you want to do is make a GUI so you can change 3 variables? How's this?

Code: Select all

StartValue := EndValue := LocationValue := 0

Gui, Add, Edit, vEdit1, start
Gui, Add, Edit, vEdit2, end
Gui, Add, Edit, vEdit3, location
Gui, Add, Button,, Change
Gui, Show,, Edit
return

ButtonChange:
	Gui, Submit
	StartValue := Edit1
	EndValue := Edit2
	LocationValue := Edit3
	Gui, Destroy
	MsgBox % "Your variables are " StartValue ", " EndValue ", and " LocationValue
return

GuiClose:
	Gui, Destroy
return
If you want to make it look pretty, you can check out the documentation to figure out how to do that (basically just define x, y, width, and height for all the elements and the gui itself).
I have no idea what I'm doing.
codude
Posts: 101
Joined: 12 Nov 2015, 05:33

Re: Set variables in a GUI.

22 Sep 2018, 09:59

Just what I needed!! Thanks for the help here.

Return to “Ask For Help”

Who is online

Users browsing this forum: 8bitgunny, Bing [Bot], Google [Bot], kczx3, wise_mike and 57 guests