GUICtrlCreateCombo Finalized

3 posts in this topic

is there a way to tell if the GUICtrlCreateCombo is open or closed (currently being chosen).

I have a logic set that reads GUICtrlCreateCombo and then does a database query. I would rather wait until the drop down closes, before the real time query is made instead of cycling though the choices.

is there a way to tell if its open or closed for a read?

Share this post

Link to post
Share on other sites

You could use a button that when clicked reads the combobox instead of looking for the state of the combo to change. ComboBoxes are very fidgety when you try to read from them as they're being accessed. You'll get a lot of notifications whenever the combo is clicked on, or when you scroll through the selections, etc.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post

Link to post
Share on other sites


I often use a logic gate with _GUICtrlComboBox_GetDroppedState for this - wait until the dropdown opens and set a flag; if the flag is there and it has closed again, fire the action.


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • PINTO1927
      By PINTO1927
      Hi guys,
      I would like to implement the words in GuiCtrlCreateEdit through the choices the GuiCtrlCreateCombo. Each item in the GuiCtrlCreateCombo must contain the words that are to be reported later in the GuiCtrlCreateEdit. I have attached an example , I added just a GuiCtrlCreateCombo , then it will insert more.
      Thanks for the attention

    • theolonghair
      By theolonghair
      Hello, Hereby I'd like to ask for the devs proffesional help cause there is
      something I can not get to work. I have an Combobox containing 3 strings.
      When I choose one, I'd wish for the 'readonly'editbox to hold some data from
      each string, a different data.
      string 1-> GUICtrlEdit /Edit1 : data ; blabla
      string 2-> GUICtrlEdit /Edit1  : data ; random typin
      string 3-> GUICtrlEdit /Edit1 : data ; other info

      Just to give an example
      I have a hunge it has something to do with
      and a read command.
      I shall provide a KodaForm generated code script.au3 below but I'm kinda lost in how to get it done.
      If only I had the beginning from one of the strings I'd make the ones for the other strings myself.

      Kind regards Theo Van Der Wal, Frieschepalen, Holland
    • galan2015
      By galan2015
      ;I'd like to on the end of the function, script changed for another option in the combolist. This will be part of the loop #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 418, 177, 192, 114) $Combo1 = GUICtrlCreateCombo("exe Files", 16, 24, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GuiCtrlSetData(-1,'ini Files|Txt Files|Cfg files') $Combo2 = GUICtrlCreateCombo("Find A", 176, 24, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GuiCtrlSetData(-1,'Find B') $Input1 = GUICtrlCreateInput("Input1", 16, 56, 321, 21) $Button = GUICTRLCreateButton("check", 10, 10, 20,20) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 16, 80, 97, 25) $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 120, 80, 97, 25) $Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 224, 80, 113, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd  
    • galan2015
      By galan2015
      Hello, i have question. How put data from _FileListToArray to Combo ?
      I want fill combo with names of files from folder.
    • poila
      By poila
      Sample code:
      ; Enter username to transfer item to Input $newUserInput = GUICtrlCreateCombo("", 180, 170, 350, 35, BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL, $CBS_SORT)) GUICtrlSetFont(-1, 14, 400, 0, "Tahoma") GUICtrlSendMsg(-1, $CB_SETMINVISIBLE, 10, 0) Part 2 of sample code:
      If $itemString <> "" Then Local $mySQLstatement = "SELECT * FROM Inventory WHERE Name = '" & $itemString & "' AND Status = 1" $executeStatement = _Query($global_SQLInstance, $mySQLstatement) $internalName = $executeStatement.Fields("Name").value $usernameID = $executeStatement.Fields("UserID").value GUICtrlSetData($userInput, getName("User", $usernameID)) GUICtrlSetData($itemInput, "|" & getString("UserItem", $usernameID) & "|", $Name) GUICtrlSetData($newUserInput, "|" & getString("Username", $usernameID)) EndIf Is it possible to prevent users from changing selection of items in the combobox?
      If so, is it possible to retrieve the value or data of the item currently shown in the combobox?
      If so/not so, how do I retrieve the value of item displayed?