Merchants Posted October 22, 2014 Posted October 22, 2014 i want to set text in a combo input without make a item of it $Input1 = GuiCtrlCreatecombo("", 10, 10, 100, 20)
Jewtus Posted October 22, 2014 Posted October 22, 2014 Have you tried: $Input1 = GuiCtrlCreatecombo("These|Are|different|Drop|downs", 10, 10, 100, 20)
Moderators Melba23 Posted October 22, 2014 Moderators Posted October 22, 2014 Merchants,You need a "cuebanner": #include <GUIConstantsEx.au3> #include <GuiComboBox.au3> $hGUI = GUICreate("Test", 500, 500) $cCombo = GUICtrlCreateCombo("", 10, 10, 300, 20) GUICtrlSetData($cCombo, "These|are|the|selections") _GUICtrlComboBox_SetCueBanner($cCombo, "Not a selection") $cButton = GUICtrlCreateButton("Test", 10, 50, 80, 30) GUICtrlSetState($cButton, $GUI_FOCUS) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndNote that the text is only visible when the combo does not have focus - which is why I added the button. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Merchants Posted October 22, 2014 Author Posted October 22, 2014 M23 not bad, but it was not what i was looking for i know one solution but only if there is no other way can you confirm this M23? #include <GUIConstantsEx.au3> #include <GuiComboBox.au3> $hGUI = GUICreate("Test", 500, 500) $cCombo = GUICtrlCreateCombo("", 10, 10, 300, 20) GUICtrlSetData($cCombo, "These|are|the|selections") _GUICtrlComboBox_SetCueBanner($cCombo, "Not a selection") $cButton = GUICtrlCreateButton("Test", 10, 50, 80, 30) $testButton = GUICtrlCreateButton("Test2", 10, 100, 80, 30) GUICtrlSetState($cButton, $GUI_FOCUS) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $testButton ControlSetText("[CLASS:AutoIt v3 GUI]", "", "[CLASS:Edit; INSTANCE:1]", "New Text Here" ) EndSwitch WEnd
Moderators Melba23 Posted October 22, 2014 Moderators Posted October 22, 2014 Merchants, M23 not bad, but it was not what i was looking forBut it is exactly what you asked for - you need to explain your requirements more carefully in future. If you want to rest the cuebanner within the script then you just need to redefine it: #include <GUIConstantsEx.au3> #include <GuiComboBox.au3> $hGUI = GUICreate("Test", 500, 500) $cCombo = GUICtrlCreateCombo("", 10, 10, 300, 20) GUICtrlSetData($cCombo, "These|are|the|selections") _GUICtrlComboBox_SetCueBanner($cCombo, "Not a selection") $cButton = GUICtrlCreateButton("Test", 10, 50, 80, 30) $testButton = GUICtrlCreateButton("Test2", 10, 100, 80, 30) GUICtrlSetState($cButton, $GUI_FOCUS) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $testButton _GUICtrlComboBox_SetCueBanner($cCombo, "New text here") EndSwitch WEndM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Merchants Posted October 22, 2014 Author Posted October 22, 2014 (edited) you need to explain your requirements more carefully in future. i am sorry but i have done that i want to set text in a combo input without make a item of it i want to use/edit the new text in the combo input not when i click it and it disappears.. if i use GUICtrlSetData then it wil make a item of it and that is not what i want that was my requirements Edited October 22, 2014 by Merchants
Moderators Solution Melba23 Posted October 22, 2014 Moderators Solution Posted October 22, 2014 Merchants,I understand now - and the only way I can imagine it is possible is the method you have shown above, although you can streamline the syntax a bit: #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $cCombo = GUICtrlCreateCombo("", 10, 10, 300, 20) GUICtrlSetData($cCombo, "|These|are|the|selections") ControlSetText($hGUI, "", $cCombo, "Not a selection") $cButton = GUICtrlCreateButton("Change Text", 10, 50, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton ControlSetText($hGUI, "", $cCombo, "Nor is this a selection either") EndSwitch WEndM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
jdelaney Posted October 22, 2014 Posted October 22, 2014 (edited) here (_GUICtrlComboBox_GetEditText): #include <GUIConstantsEx.au3> #include <GuiComboBox.au3> $hGUI = GUICreate("Test", 500, 500) $cCombo = GUICtrlCreateCombo("", 10, 10, 300, 20) GUICtrlSetData($cCombo, "These|are|the|selections") _GUICtrlComboBox_SetCueBanner($cCombo, "Not a selection") $cButton = GUICtrlCreateButton("Test", 10, 50, 80, 30) $testButton = GUICtrlCreateButton("Test2", 10, 100, 80, 30) $test2Button = GUICtrlCreateButton("Test3", 10, 150, 80, 30) GUICtrlSetState($cButton, $GUI_FOCUS) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $testButton _GUICtrlComboBox_SetCueBanner($cCombo, "New text here") Case $test2Button ConsoleWrite(_GUICtrlComboBox_GetEditText($cCombo) & @CRLF) EndSwitch WEnd edit: oops, I got the requirement backwards...I think. Edited October 22, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Merchants Posted October 22, 2014 Author Posted October 22, 2014 (edited) I understand now - and the only way I can imagine it is possible is the method you have shown above, although you can streamline the syntax a bit: ok then i wil use that quick question: the combo box can show 30 items when clicked down by default is there a way to increased that? i wana see 50 items without scrolling down for it Edited October 22, 2014 by Merchants
jdelaney Posted October 22, 2014 Posted October 22, 2014 check out the function lists in the helpfile...they are named exactly like what they do: #include <GUIConstantsEx.au3> #include <GuiComboBox.au3> $hGUI = GUICreate("Test", 500, 500) $cCombo = GUICtrlCreateCombo("", 10, 10, 300, 20) GUICtrlSetData($cCombo, "These|are|the|selections|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|1|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!!|!") _GUICtrlComboBox_SetMinVisible($cCombo,_GUICtrlComboBox_GetCount($cCombo)) _GUICtrlComboBox_SetCueBanner($cCombo, "Not a selection") $cButton = GUICtrlCreateButton("Test", 10, 50, 80, 30) $testButton = GUICtrlCreateButton("Test2", 10, 100, 80, 30) $test2Button = GUICtrlCreateButton("Test3", 10, 150, 80, 30) GUICtrlSetState($cButton, $GUI_FOCUS) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $testButton _GUICtrlComboBox_SetCueBanner($cCombo, "New text here") Case $test2Button ConsoleWrite(_GUICtrlComboBox_GetEditText($cCombo) & @CRLF) EndSwitch WEnd IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Merchants Posted October 22, 2014 Author Posted October 22, 2014 (edited) check out the function lists in the helpfile...they are named exactly like what they do: #include <GUIConstantsEx.au3> #include <GuiComboBox.au3> $hGUI = GUICreate("Test", 500, 500) $cCombo = GUICtrlCreateCombo("", 10, 10, 300, 20) GUICtrlSetData($cCombo, "These|are|the|selections|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|1|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!|!!|!") _GUICtrlComboBox_SetMinVisible($cCombo,_GUICtrlComboBox_GetCount($cCombo)) _GUICtrlComboBox_SetCueBanner($cCombo, "Not a selection") $cButton = GUICtrlCreateButton("Test", 10, 50, 80, 30) $testButton = GUICtrlCreateButton("Test2", 10, 100, 80, 30) $test2Button = GUICtrlCreateButton("Test3", 10, 150, 80, 30) GUICtrlSetState($cButton, $GUI_FOCUS) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $testButton _GUICtrlComboBox_SetCueBanner($cCombo, "New text here") Case $test2Button ConsoleWrite(_GUICtrlComboBox_GetEditText($cCombo) & @CRLF) EndSwitch WEnd SetMinVisible oké thank you for you a thumb up Edited October 22, 2014 by Merchants
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