Update options in GUI control

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Sinisterbot_7900

Update options in GUI control

26 Jul 2017, 02:02

I'm trying to change the range of a GUI UpDown control after a user checks a checkbox. My GUI looks something like this:

Code: Select all

num = 0

StartGui:
	Gui, Add, Checkbox, gGuiUpdate vCB1, Check me
	Gui, Add, Edit, Number -Wrap Limit1 vEditRand
	Gui, Add, UpDown, vRandUpDown Range0-6, 0
	Gui, Show
Return

GuiUpdate:
	Read := array(0)
	GuiControlGet, retrievedVal,, IV1
	Read[1] := retrievedVal
	Update(Read)
Return

Update(result){
	for i, element in result{
		if element=1
		num++
	}
	cap := 6-num
	GuiControl, UpDown, RandUpDown, Range0-%cap% ;I want to do this!
}
So if the user checks the checkbox, the range is reduced by 1.
Is there any way to do this? I've been looking around for a few hours to no avail.
sinisterbot
Posts: 6
Joined: 26 Jul 2017, 02:06

Re: Update options in GUI control

26 Jul 2017, 02:14

Just made an account after posting this -_- Not sure how to edit that post now, but the IV1 should be CB1. That's a typo.
sinisterbot
Posts: 6
Joined: 26 Jul 2017, 02:06

Re: Update options in GUI control

26 Jul 2017, 13:35

After a bit more searching, I'm unable to come up with the solution - does anyone know?
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: Update options in GUI control

26 Jul 2017, 15:50

GuiControl, +Range0-%cap%, RandUpDown.
Also check the values you work with, e.g. what is IV1...?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mapcarter, Marium0505, Rohwedder and 368 guests