Sign in to follow this  
Followers 0
ARozanski

Setting the state of a checkbox...

3 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

thank you very much!!

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0