Sign in to follow this  
Followers 0
gigilihooie

Select two or more checkboxes

6 posts in this topic

Is there a way to have a button click two or more click boxes on the GUI?

I could not figure it out.

Share this post


Link to post
Share on other sites



Is there a way to have a button click two or more click boxes on the GUI?

I could not figure it out.

Do You Mean.. You Have A Button In Your GUI That Clicks 2+ Check-Boxes On The Same GUI? If So Then Here :

#Include <GUIConstants.Au3>
Opt ('GUIOnEventMode','1')
#NoTrayIcon

$GUI = GUICreate ('Example','96','43','-1','-1','-1','128')
GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit')
$Check_Box_1 = GUICtrlCreateCheckBox ('','5','5','15','15')
$Check_Box_2 = GUICtrlCreateCheckBox ('','5','24','15','15')
$Button = GUICtrlCreateButton ('Select','25','10','65','23')
GUICtrlSetOnEvent ($Button, '_Toggle_Select')
GUISetState (@SW_SHOW, $GUI)

While ('1')


Sleep ('150')
WEnd

Func _Toggle_Select ()
If BitAnd (GUICtrlRead ($Check_Box_1), $GUI_UNCHECKED) <> '0' And BitAnd (GUICtrlRead ($Check_Box_2), $GUI_UNCHECKED) <> '0' Then 
GUICtrlSetState ($Check_Box_1, $GUI_CHECKED)
GUICtrlSetState ($Check_Box_2, $GUI_CHECKED)
GUICtrlSetData ($Button, 'Un-Select')
Else
GUICtrlSetState ($Check_Box_1, $GUI_UNCHECKED)
GUICtrlSetState ($Check_Box_2, $GUI_UNCHECKED)
GUICtrlSetData ($Button, 'Select')
EndIf 
EndFunc

Func _Exit ()
Exit
EndFunc

Hope This Helps :)!

- John


Latest Projects :- New & Improved TCP Chat

Share this post


Link to post
Share on other sites

Is there a way to have a button click two or more click boxes on the GUI?

I could not figure it out.

I don't understand. Please be more clearly.


When the words fail... music speaks

Share this post


Link to post
Share on other sites

Perfect John2006, thenkyou very much. :)

Share this post


Link to post
Share on other sites

Another version for _Toggle_Select()

Func _Toggle_Select ()
If GUICtrlRead($Check_Box_1) = 4 And GUICtrlRead($Check_Box_2) = 4 Then
    ControlCommand("Example","",$Check_Box_1,"Check","")
    ControlCommand("Example","",$Check_Box_2,"Check","")
Else
    ControlCommand("Example","",$Check_Box_1,"UnCheck","")
    ControlCommand("Example","",$Check_Box_2,"UnCheck","")
EndIf
EndFunc

When the words fail... music speaks

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