sharrakor Posted February 1, 2009 Posted February 1, 2009 I made a gui for my program that saves values to an ini file. I was wondering though, how can I make it so that the next time the user starts the program and brings up the gui, the correct values are checked? What kind of variable would I use and how would I go about doing it?
Pain Posted February 1, 2009 Posted February 1, 2009 (edited) Save the value with GUICtrlRead($checkbox). Use this when you create your GUI (startup). $checkbox = GUICtrlCreateCheckbox("My checkbox", 40, 200, 250, 20) GUICtrlSetState(-1, IniRead("file.ini", "Check", "Checkbox1", 4)) A checkbox can have two values, 1 or 4 depending on if it's selected or not. 1 = checked 4 = unchecked Edited February 1, 2009 by Pain
sharrakor Posted February 1, 2009 Author Posted February 1, 2009 Thanks. Exactly what I needed to know. I'm assuming the same thing would apply for a dropdown list (guictrlsetdata)? Except with the value I want?
sharrakor Posted February 1, 2009 Author Posted February 1, 2009 So how do I read the value (1 or 4)? If I see what the value of the box is equal to, it just gives me the control ID. Sorry for the basic question.
Pain Posted February 1, 2009 Posted February 1, 2009 IniWrite("file.ini", "Checkbox", "Checkbox1", GUICtrlRead($checkbox))
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now