Variable = [Hey, No, Wait] Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Jonas353
Posts: 64
Joined: 13 Oct 2017, 06:37

Variable = [Hey, No, Wait]

08 Mar 2018, 13:29

I would like to make something like this. Can't find anything similar on the forums.

Code: Select all

Variable = [Hey, No, Wait]
GuiControl, Hide, %Variable%
User avatar
TheDewd
Posts: 1510
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Variable = [Hey, No, Wait]

08 Mar 2018, 13:46

Your intentions are not clear if you want to hide a single control with the text "[Hey, No, Wait]" or 3 individual controls having either "Hey", "No", or "Wait", etc... I assumed the first.

Code: Select all

#SingleInstance, Force

Toggle := 0
Variable := "[Hey, No, Wait]"

Gui, Margin, 10, 10
Gui, Add, Text,, % Variable
Gui, Add, Button, w80 h24 gToggle, Toggle
Gui, Show, w400 h200, Example
return

Toggle:
	Toggle := !Toggle
	GuiControl, % (Toggle ? "Hide" : "Show"), % Variable
return
Jonas353
Posts: 64
Joined: 13 Oct 2017, 06:37

Re: Variable = [Hey, No, Wait]

08 Mar 2018, 14:01

I want one control to hide this

Code: Select all

Variable := [Hey, No, Wait]

Gui, Add, Text, vHey, Lol 
Gui, Add, Text, vNo, How 
Gui, Add, Text, vWait, What
Gui, Add, Button, gButton, Button

Button:
GuiControl, Hide, %Variable%
return
User avatar
TheDewd
Posts: 1510
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Variable = [Hey, No, Wait]  Topic is solved

08 Mar 2018, 14:08

For-Loop
https://autohotkey.com/docs/commands/For.htm

Code: Select all

#SingleInstance, Force

Variable := ["Hey", "No", "Wait"]

Gui, Add, Text, vHey, Lol 
Gui, Add, Text, vNo, How 
Gui, Add, Text, vWait, What
Gui, Add, Button, gButton, Button
Gui, Show, w400 h200, Example
return

Button:
	For Key, Value In Variable {
		GuiControl, Hide, % Value
	}
return
Jonas353
Posts: 64
Joined: 13 Oct 2017, 06:37

Re: Variable = [Hey, No, Wait]

08 Mar 2018, 14:20

Thanks @TheDewd yours worked!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], joedf, MiM, ntepa, supplementfacts and 143 guests