Search the Community
Showing results for tags 'parent checkbox'.
-
I've read the help file, but can't find a solution. How to enable a (disabled) checkbox only when another checkbox has been checked? Once "Cats?" checkbox has been checked, I want the Label "Number of Cats" to be enabled and allow numeric-only input of Input Box $InputCatNo After inputting a number and pressing the Go button, I want to run notepad and send the inputted number to notepad. Thank you in advance for advice or pointing me to a help file. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Math.au3> #include <GUIConstantsEx.au3> #include <Misc.au3> Global $InputCatNo, $InputCatNo2 While 1 _Animal() Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send($InputCatNo2) ExitLoop WEnd Func _Animal() $aAnimal = GUICreate("Animals", 342, 273, 509, 166) $CBcCats = GUICtrlCreateCheckbox("Cats?", 115, 25, 97, 25) GUICtrlSetFont(-1, 16, 400, 0, "Calibri") $LblCat=GUICtrlCreateLabel("Number of Cats", 32, 54, 113, 23, $SS_RIGHT) GUICtrlSetFont(-1, 12, 400, 0, "Calibri") GUICtrlSetstate($LblCat,$GUI_DISABLE) $InputCatNo = GUICtrlCreateInput("", 152, 54, 137, 23, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER)) GUICtrlSetFont(-1, 10, 400, 0, "Calibri") GUICtrlSetstate($InputCatNo,$GUI_DISABLE) $BTNGo = GUICtrlCreateButton("GO", 104, 176, 97, 57) GUICtrlSetFont(-1, 24, 400, 0, "Calibri") GUISetState(@SW_SHOW) $msg = GUIGetMsg() Switch GUIGetMsg() Case GUICtrlRead($CBcCats) = $GUI_CHECKED GUICtrlSetState($LblCat,$GUI_ENABLE) GUICtrlSetState($InputCatNo,$GUI_ENABLE) If GUICtrlRead($InputCatNo) <> "" Then $InputCatNo2 = GUICtrlRead($InputCatNo) Else $InputCatNo2 = "" EndIf EndSwitch While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $BTNGo ExitLoop EndSelect WEnd Select Case $msg = $BTNGo GUISetState(@SW_HIDE) EndSelect EndFunc ;=> _Animal
- 10 replies