Sign in to follow this  
Followers 0
Mast3rpyr0

Checkbox help

4 posts in this topic

Ok i got a checkbox and depending on a key in an INI file it should start off checked. Ive tried

If $doCompress = "True" Then
$doCompressConfig = GUICtrlCreateCheckbox("Compress Backups", 75, 90, -1, -1, -1, $GUI_CHECKED) <--Done this in both style positions.
Else
$doCompressConfig = GUICtrlCreateCheckbox("Compress Backups", 75, 90);
EndIf

and

If $doCompress = "True" Then
$doCompressConfig = GUICtrlCreateCheckbox("Compress Backups", 75, 90);
GUICtrlSetData($doCompressConfig, $GUI_CHECKED)
Else
$doCompressConfig = GUICtrlCreateCheckbox("Compress Backups", 75, 90);
EndIf

Did i miss something?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Try this....

If $doCompress = "True" Then
GUICtrlSetState($doCompressConfig , $GUI_CHECKED)
Else
GUICtrlSetState($doCompressConfig , $GUI_UNCHECKED)
EndIf

Just make sure the checkbox is created before hand, that way this will just change it's status.

It looks light you had it right in the second one. Just instead of "GUICtrlSetData" use "GUICtrlSetState" =)

Edited by SteveO

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