Jump to content

Checkbox help


Recommended Posts

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?

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

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