lrstndm Posted August 26, 2011 Share 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 Link to comment Share on other sites More sharing options...
Zedna Posted August 26, 2011 Share 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 Link to comment Share on other sites More sharing options...
lrstndm Posted August 26, 2011 Author Share Posted August 26, 2011 Thanks thats exactly what i wanted!!! 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