Info Posted March 11, 2008 Share Posted March 11, 2008 (edited) #include <GUIConstants.au3> GUICreate("O_O", 170, 174, 370, 235, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE)) $Input1 = GUICtrlCreateInput ( ">_<", 8, 8, 150, 20, $ES_READONLY) $CheckBox = GUICtrlCreateCheckbox ( "CheckBox", 5, 42.5, 130, 15) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd I want it to remove the "$ES_READONLY" from the Input when I check the CheckBox... HOW? THANKS Edited March 11, 2008 by Info Link to comment Share on other sites More sharing options...
picaxe Posted March 11, 2008 Share Posted March 11, 2008 Try this #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) GUICreate("O_O", 170, 174, 370, 235, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE)) $Input1 = GUICtrlCreateInput ( ">_<", 8, 8, 150, 20) GUICtrlSetState(-1, $GUI_DISABLE) $CheckBox = GUICtrlCreateCheckbox ( "CheckBox", 5, 42.5, 130, 15) GUICtrlSetOnEvent(-1, "Chk") GUISetOnEvent($GUI_EVENT_CLOSE, "FormClose") GUISetState (@SW_SHOW) While 1 Sleep(1000) WEnd Func Chk() If BitAND(GUICtrlRead($CheckBox), $GUI_CHECKED) Then GUICtrlSetState($Input1, $GUI_ENABLE) Else GUICtrlSetState($Input1, $GUI_DISABLE) EndIf EndFunc Func FormClose() Exit EndFunc Link to comment Share on other sites More sharing options...
smashly Posted March 11, 2008 Share Posted March 11, 2008 Hi, #include <GUIConstants.au3> GUICreate(":-)", 170, 174, 370, 235, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE)) $Input1 = GUICtrlCreateInput ( ">_<", 8, 8, 150, 20, $ES_READONLY) $CheckBox = GUICtrlCreateCheckbox ( "CheckBox", 5, 42.5, 130, 15) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $CheckBox If BitAnd(GUICtrlRead($CheckBox), $GUI_CHECKED) Then GUICtrlSetStyle($Input1, $GUI_SS_DEFAULT_INPUT) GUICtrlSetState($Input1, $GUI_FOCUS) Else GUICtrlSetStyle($Input1, $ES_READONLY) EndIf EndSwitch WEnd Cheers Link to comment Share on other sites More sharing options...
Info Posted March 11, 2008 Author Share Posted March 11, 2008 Thank you guys 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