Jump to content

Recommended Posts

Posted

I have created a GUI that saves certain settings...such as wether a checkbox is checked or not...it saves the data to an .ini file - so if the checkbox is checked =1 if unchecked =0...how do i get the checkbox to be checked when i run the GUI if the data in the .ini is already = 1...

thank you in advance...

Posted

I have created a GUI that saves certain settings...such as wether a checkbox is checked or not...it saves the data to an .ini file - so if the checkbox is checked =1 if unchecked =0...how do i get the checkbox to be checked when i run the GUI if the data in the .ini is already = 1...

thank you in advance...

you can do something like:

#include <GuiConstantsEx.au3>

GUICreate("")
GUISetState(@sw_show)
$box = GUICtrlCreateCheckbox("Test",10,10)

$ini = IniRead("File.ini","default", 1, -1)

If $ini = 1 Then
    GUICtrlSetState($box, $GUI_CHECKED)
ElseIf $ini = 0 Then
    GUICtrlSetState($box, $GUI_UNCHECKED)
EndIf

While 1
    $msg = GUIGetMsg()
    if $msg = $GUI_EVENT_CLOSE Then
        Exit
    EndIf   
WEnd

good luck with the rest

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...