[Beginner] Code to Check a Checkbox Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Pharma
Posts: 26
Joined: 13 Dec 2016, 18:14

[Beginner] Code to Check a Checkbox

19 Jan 2018, 20:36

Hello all,

So I'm importing text from a .txt file.
(Will be a .json file, but no matter)
Here's enough of the code to get the job done.
I think I'm only missing 1-3 lines of code.

What do I add to the Call_Load() so that the script will check or uncheck a checkbox?
So that if I reload the script, the button will be checked or unchecked

Code: Select all

	Gui, Add, CheckBox, y5 x50  w15 h15 vPrivate Checked 
	Gui, Add, Button, y40 x50, Update
	Gui, Show, w180 h80, Check
	Return

	ButtonUpdate:	
		Gui, Submit, NoHide
		FileDelete, %A_ScriptDir%\values.txt
		FileAppend, %Private%, %A_ScriptDir%\values.txt
		Call_Load()
	
	Call_Load() 
		{
			FileReadLine, Private_I, %A_ScriptDir%\values.txt, 1	
		}
User avatar
boiler
Posts: 16949
Joined: 21 Dec 2014, 02:44

Re: [Beginner] Code to Check a Checkbox  Topic is solved

19 Jan 2018, 20:41

GuiControl,, Private, 1 to check. 0 instead of 1 to uncheck.
Pharma
Posts: 26
Joined: 13 Dec 2016, 18:14

Re: [Beginner] Code to Check a Checkbox

19 Jan 2018, 20:43

boiler wrote:GuiControl,, Private, 1 to check. 0 instead of 1 to uncheck.
Boy, you sure torched that one.

I think I tried like 20 permutations of that syntax and missed the one that matters.
Cheers!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], mebelantikjaya and 300 guests