checking checkboxes

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
bigdeal
Posts: 66
Joined: 13 Feb 2017, 06:31

checking checkboxes

17 Feb 2017, 12:04

hey there, I want to shorten my script, but my code vocabulaire is not much, so I would be glad if someone could help me out. I've multiple checkboxes and if I check one I want an action to happen, now the first script works but I want to add this to other scripts which have more or less hotkeys which I would need to manually add or remove, and would give me alot of handpain, does someone know how I can automate this like the second example?

Code: Select all

Checkbox:								
Gui, Submit, NoHide
if (Checkbox1)
Hotkey, %Hotkey1%, HotkeyA, on
else
Hotkey, %Hotkey1%, HotkeyA, off
if (Checkbox2)
Hotkey, %Hotkey2%, HotkeyA, on
else
Hotkey, %Hotkey2%, HotkeyA, off
...
return

Code: Select all

Checkbox:								
Gui, Submit, NoHide
Loop,
{
hotkey:=hotkey%index%
if (Checkbox%index%)
Hotkey, %hotkey%, Hotkey%indexwithletter%, on
else
Hotkey, %hotkey%, Hotkey%indexwithletter%, off
}
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Aqualest, Bing [Bot], sachalamp and 446 guests