japino Posted November 17, 2007 Share Posted November 17, 2007 I'm creating my first script with a GUI and I have created a dialog with a checkbox and an indented checkbox below the first checkbox. The indented checkbox should be deselected as soon as the user deselects the first checkbox. How should I go about this? Link to comment Share on other sites More sharing options...
MadBoy Posted November 17, 2007 Share Posted November 17, 2007 (edited) expandcollapse popup; This ain't working code but should give you idea how to ;) Opt("GUIOnEventMode", 1) $checkbox_1 = GUICtrlCreateCheckbox("Show log window", 12 + 323, 19) $checkbox_2 = GUICtrlCreateCheckbox("Do something else", 12 + 323, 19 + 20) GUICtrlSetOnEvent($checkbox_1, "_CheckboxStatusOne") GUICtrlSetOnEvent($checkbox_2, "_CheckboxStatusTwo") Func _CheckBoxStatusOne() GUICtrlSetState($checkbox_2, $GUI_UNCHECKED) EndFunc ;==>_CheckBoxStatusOne Func _CheckboxStatusTwo() GUICtrlSetState($checkbox_1, $GUI_UNCHECKED) EndFuncoÝ÷ ØGb´Z}ýµ¦âקíz¶¥ÚæzÊ&zØb(®H Ê!z·²¢è(jëh×6; Working example #Include <GUIConstants.au3> Opt("GUIOnEventMode", 1) $Gui_Main = GuiCreate("Temp", 600, 600) $checkbox_1 = GUICtrlCreateCheckbox("Show log window", 12 + 323, 19) $checkbox_2 = GUICtrlCreateCheckbox("Do something else", 12 + 323, 19 + 20) GUICtrlSetOnEvent($checkbox_1, "_CheckboxStatusOne") GUICtrlSetOnEvent($checkbox_2, "_CheckboxStatusTwo") GUISetState(@SW_SHOW, $Gui_Main) While 1 Sleep(1000) Wend Func _CheckBoxStatusOne() GUICtrlSetState($checkbox_2, $GUI_UNCHECKED) EndFunc ;==>_CheckBoxStatusOne Func _CheckboxStatusTwo() GUICtrlSetState($checkbox_1, $GUI_UNCHECKED) EndFunc Edited November 17, 2007 by MadBoy My little company: Evotec (PL version: Evotec) Link to comment Share on other sites More sharing options...
japino Posted November 18, 2007 Author Share Posted November 18, 2007 Thanks a mil'! I'll give it a try. Link to comment Share on other sites More sharing options...
BrettF Posted November 18, 2007 Share Posted November 18, 2007 Same thing but using GUIGetMsg... ; Working example #Include <GUIConstants.au3> $Gui_Main = GUICreate("Temp", 600, 600) $checkbox_1 = GUICtrlCreateCheckbox("Show log window", 12 + 323, 19) $checkbox_2 = GUICtrlCreateCheckbox("Do something else", 12 + 323, 19 + 20) GUISetState(@SW_SHOW, $Gui_Main) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $checkbox_1 GUICtrlSetState($checkbox_2, $GUI_UNCHECKED) Case $msg = $checkbox_2 GUICtrlSetState($checkbox_1, $GUI_UNCHECKED) EndSelect WEnd Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! 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