Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ButtonConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <WindowsConstants.au3>
- Opt ("GuiOnEventMode",1)
- $Form = GUICreate("GUI", 600, 450)
- $Button_P = GUICtrlCreateButton("Disable Buttons \/", 50, 30, 120, 25)
- Global $Button[6]
- For $i = 0 To 5
- $Button[$i] = GUICtrlCreateButton("Button "&$i, 80, 65+$i*26 + 3, 75, 25)
- GUICtrlSetOnEvent($Button[$i],"Controls")
- Next
- GUISetOnEvent(-3,"EXIT_F")
- GUICtrlSetOnEvent($Button_P,"Controls")
- Global $DISABLE = False
- GUISetState(@SW_SHOW)
- While 1
- WEnd
- Func EXIT_F()
- Exit
- EndFunc
- Func Controls()
- Switch @GUI_CtrlId
- Case $Button_P
- Local $State = $GUI_DISABLE
- If $DISABLE = True Then
- $State = $GUI_ENABLE
- $DISABLE = False
- GUICtrlSetData($Button_P,"Disable Buttons \/")
- Else
- $DISABLE = True
- GUICtrlSetData($Button_P,"Enable Buttons \/")
- EndIf
- For $i = 0 To 5 Step 1
- GUICtrlSetState($Button[$i],$State)
- Next
- Case $Button[0] to $Button[5]
- MsgBox(0,@GUI_CtrlId,GUICtrlRead(@GUI_CtrlId))
- EndSwitch
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement