vladedoty Posted September 8, 2009 Share Posted September 8, 2009 I know how to enable a combobox if a checkbox is checked. but if i check it again to uncheck it i have no clue how to disable the combobox after it has been enabled other question is how do i change text in one combo box everytime something different is selceted from a different combo box. Link to comment Share on other sites More sharing options...
smashly Posted September 8, 2009 Share Posted September 8, 2009 (edited) Hi,#include <GUIConstantsEx.au3> $hGui = GUICreate(":-)", 375, 60) $iCombo1 = GUICtrlCreateCombo("", 5, 5, 180, 20) GUICtrlSetData(-1, "Day|Night|Morning|Afternoon", "Day") $iCombo2 = GUICtrlCreateCombo("", 190, 5, 180, 20) GUICtrlSetData(-1, "Day|Night|Morning|Afternoon", "Night") $iCheckbox = GUICtrlCreateCheckbox("Disable Combo1", 5, 35, 100, 20) GUISetState(@SW_SHOW, $hGui) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $iCombo1 GUICtrlSetData($iCombo2, GUICtrlRead($iCombo1), GUICtrlRead($iCombo1)) Case $iCombo2 GUICtrlSetData($iCombo1, GUICtrlRead($iCombo2), GUICtrlRead($iCombo2)) Case $iCheckbox If BitAND(GUICtrlRead($iCheckbox), $GUI_CHECKED) Then GUICtrlSetState($iCombo1, $GUI_DISABLE) Else GUICtrlSetState($iCombo1, $GUI_ENABLE) EndIf EndSwitch WEnd Cheers Edited September 8, 2009 by smashly Link to comment Share on other sites More sharing options...
Manjish Posted September 9, 2009 Share Posted September 9, 2009 other question is how do i change text in one combo box everytime something different is selceted from a different combo box.guictrlread() your first checkbox and then guictrlsetdata() your second checkbox. Hope it helps. If you didn't get what I mean, then I ll post a sample code. But it's pretty straightforward, what I mean. [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com 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