HezzelQuartz Posted September 29 Share Posted September 29 How to detect whether combo box in GUICtrlCreateCombo has been choosen or not? for example: $Input_Quantity = GUICtrlCreateCombo("",260,530-4,50,30) GUICtrlSetData($Input_Quantity, "1|2|3|4|5|6|7|8|9|10", "") If user choose one of the choice, the combo box background become green How to do that? Link to comment Share on other sites More sharing options...
ahmet Posted September 29 Share Posted September 29 Here is modified example from help file expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WinAPIGdi.au3> Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 300, 200) ; Create a combobox control. Local $idComboBox = GUICtrlCreateCombo("", 10, 10, 185, 20) Local $idButton_Close = GUICtrlCreateButton("Close", 210, 170, 85, 25) ; Add additional items to the combobox. GUICtrlSetData($idComboBox, "1|2|3|4|5|6|7|8|9|10", "") ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) Local $sComboRead = "" ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idButton_Close ExitLoop Case $idComboBox ;here are actions that will be done when user choses value from combobox GUICtrlSetBkColor($idComboBox,0x00FF00) _WinAPI_RedrawWindow($hGUI) ;$sComboRead = GUICtrlRead($idComboBox) ;MsgBox($MB_SYSTEMMODAL, "", "The combobox is currently displaying: " & $sComboRead, 0, $hGUI) EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example When asking for help usually it is best practice to post entire code. 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