lrstndm 1 Posted August 26, 2011 Hee Guys, I have an simple gui with an checkbox (code below) What i want is that if i check the checkbox the input box have to be disabled. and when i uncheck it, the input box have to be enabled. How do i do this? Thanks in advance #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Main = GUICreate("Form1", 282, 103, 192, 124) $Input1 = GUICtrlCreateInput("Input1", 32, 24, 121, 21) $Button1 = GUICtrlCreateButton("Button1", 97, 48, 55, 25) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 160, 26, 97, 17) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Select Case $Msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Share this post Link to post Share on other sites
Zedna 278 Posted August 26, 2011 #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Main = GUICreate("Form1", 282, 103, 192, 124) $Input1 = GUICtrlCreateInput("Input1", 32, 24, 121, 21) $Button1 = GUICtrlCreateButton("Button1", 97, 48, 55, 25) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 160, 26, 97, 17) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Select Case $Msg = $GUI_EVENT_CLOSE Exit Case $Msg = $Checkbox1 If IsChecked($Checkbox1) Then GUICtrlSetState($Input1, $GUI_DISABLE) Else GUICtrlSetState($Input1, $GUI_ENABLE) EndIf EndSelect WEnd Func IsChecked($control) Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search Share this post Link to post Share on other sites
lrstndm 1 Posted August 26, 2011 Thanks thats exactly what i wanted!!! Share this post Link to post Share on other sites