probedrone Posted August 30, 2006 Share Posted August 30, 2006 Hey, anyone know of a way to create a list of checkboxes in GUI where one of them, if checked, will select all the other ones? Link to comment Share on other sites More sharing options...
Helge Posted August 30, 2006 Share Posted August 30, 2006 Something like this ?#include <GUIConstants.au3> GUICreate("", 300, 180) GUICtrlCreateLabel("Describe Helge...", 10, 10, 280, 20, $SS_CENTER) $check1 = GUICtrlCreateCheckbox("Cool", 10, 35, 280, 20, $BS_PUSHLIKE) $check2 = GUICtrlCreateCheckbox("Retarded", 10, 60, 280, 20, $BS_PUSHLIKE) $check3 = GUICtrlCreateCheckbox("Strange", 10, 85, 280, 20, $BS_PUSHLIKE) $check4 = GUICtrlCreateCheckbox("Genius", 10, 110, 280, 20, $BS_PUSHLIKE) $checkall = GUICtrlCreateCheckbox("All", 10, 150, 280, 20, $BS_PUSHLIKE) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit If $msg = $checkall Then If BitAND(GUICtrlRead($checkall), $GUI_CHECKED) Then For $i = $check1 To $check4 GUICtrlSetState($i, $GUI_CHECKED) Next Else For $i = $check1 To $check4 GUICtrlSetState($i, $GUI_UNCHECKED) Next EndIf EndIf WEnd Link to comment Share on other sites More sharing options...
probedrone Posted August 30, 2006 Author Share Posted August 30, 2006 (edited) Question 2: Say I have a subgroup of checkboxes. If I check the "select all" box, I want ALL the boxes to be checked, but when i check the "select subgroup" box, I only want those boxes in the subgroup checked. Any way to do this? Edit: nvm i got it Edited August 30, 2006 by probedrone Link to comment Share on other sites More sharing options...
Bert Posted August 30, 2006 Share Posted August 30, 2006 Its the same thing, except the checkall box would only point to the subs you want. If you look in the script where it has the variable $checkall, you will see in the while loop what happens when it is checked. just change that to point to the checkboxes you want. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now