Sign in to follow this  
Followers 0
beachteach

Unchecking Multiple Boxes From A Button

2 posts in this topic

undefined
I want to create an interface with a select all button and an unselect all button. The Select All will work fine but the Unselect will not uncheck the boxes.

#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.6 Prototype

#include <GuiConstants.au3>

GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Checkbox_1 = GuiCtrlCreateCheckbox("Checkbox1", 30, 30, 130, 20)
$Checkbox_2 = GuiCtrlCreateCheckbox("Checkbox2", 30, 50, 140, 20)
$Checkbox_3 = GuiCtrlCreateCheckbox("Checkbox3", 30, 70, 150, 20)
$Checkbox_4 = GuiCtrlCreateCheckbox("Checkbox4", 30, 90, 160, 20)
$Checkbox_5 = GuiCtrlCreateCheckbox("Checkbox5", 30, 110, 170, 20)
$Button_6 = GuiCtrlCreateButton("Select All", 40, 220, 100, 40)
$Button_7 = GuiCtrlCreateButton("Unselect All", 170, 220, 110, 40)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_6
        $Checkbox_1 = GUICtrlSetState($Checkbox_1,$GUI_CHECKED)
        $Checkbox_2 = GUICtrlSetState($Checkbox_2,$GUI_CHECKED)
    Case $msg = $Button_7
        $Checkbox_1 = GUICtrlSetState($Checkbox_1,$GUI_UNCHECKED)
        $Checkbox_2 = GUICtrlSetState($Checkbox_2,$GUI_UNCHECKED)
    Case Else
    ;;;
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---

Can anyone tell me what I am doing wrong? Thanks

Share this post


Link to post
Share on other sites



#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.6 Prototype

#include <GuiConstants.au3>

GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Checkbox_1 = GuiCtrlCreateCheckbox("Checkbox1", 30, 30, 130, 20)
$Checkbox_2 = GuiCtrlCreateCheckbox("Checkbox2", 30, 50, 140, 20)
$Checkbox_3 = GuiCtrlCreateCheckbox("Checkbox3", 30, 70, 150, 20)
$Checkbox_4 = GuiCtrlCreateCheckbox("Checkbox4", 30, 90, 160, 20)
$Checkbox_5 = GuiCtrlCreateCheckbox("Checkbox5", 30, 110, 170, 20)
$Button_6 = GuiCtrlCreateButton("Select All", 40, 220, 100, 40)
$Button_7 = GuiCtrlCreateButton("Unselect All", 170, 220, 110, 40)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_6
        GUICtrlSetState($Checkbox_1,$GUI_CHECKED)
        GUICtrlSetState($Checkbox_2,$GUI_CHECKED)
    Case $msg = $Button_7
        GUICtrlSetState($Checkbox_1,$GUI_UNCHECKED)
        GUICtrlSetState($Checkbox_2,$GUI_UNCHECKED)
    Case Else
   ;;;
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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