Jump to content

Recommended Posts

Posted

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?

Posted (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 by Pain
Posted

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?

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...