Anomalous Posted April 4, 2014 Share Posted April 4, 2014 Hi there fallos, im in lose here, need help. i have a combobox ctrl, k? i populate the combobox with data -> 'a|b|c|d|bla|bla' , k? now, i want to add another item with @TAB in the middle -> 'zaa' & @TAB & 'zoo', k? the item adds just fine, but, if i dropdown the combobox list to select somthing, i see -> zaazoo after selecting it and the dropdown closes, i see the correct format -> zaa @TAB zoo, ie, zaa zoo how to tell or format or whatever the dropdow list to show -> zaa zoo and NOT zaazoo ??? thank you very very veerrryy much. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 4, 2014 Moderators Share Posted April 4, 2014 (edited) Must you use @TAB? This works just fine for me, just adding spaces: $combo = GUICtrlCreateCombo("", 10, 10, 100, 40) GUICtrlSetData(-1, "a|b|c|d|Zaa zoo", "") Edited April 4, 2014 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 4, 2014 Moderators Share Posted April 4, 2014 (edited) Anomalous,Welcome to the AutoIt forum. Interesting question. You can set a style for a ListBox which makes it expand tabs, but this does nto seem to work for a combo - as you can see here:expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <GuiListBox.au3> #include <WinAPI.au3> #include <GUIComboBox.au3> Global $tInfo Global $aTabs[4] = [3, 100, 200, 300] $hGUI = GUICreate("Test", 500, 500) ; Create combo $cCombo = GUICtrlCreateCombo("", 10, 10, 200, 20) ; Get handle to list element _GUICtrlComboBox_GetComboBoxInfo($cCombo, $tInfo) $hList = DllStructGetData($tInfo, "hList") ; Add style $iStyle = _WinAPI_GetWindowLong($hList, $GWL_STYLE) _WinAPI_SetWindowLong($hList, $GWL_STYLE, BitOR($iStyle, $LBS_USETABSTOPS)) ; Set tab stops _GUICtrlListBox_SetTabStops($hList, $aTabs) ; Add data GUICtrlSetData($cCombo, "a|zaa" & @TAB & "zoo|b|c|d|bla|bla") ; Create list with style $cList = GUICtrlCreateList("", 10, 100, 200, 200, BitOR($LBS_STANDARD, $LBS_USETABSTOPS)) ; Set tab stops _GUICtrlListBox_SetTabStops($cList, $aTabs) ; Add data GUICtrlSetData($cList, "a|zaa" & @TAB & "zoo|b|c|d|bla|bla") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndI will keep looking to see if I can find anything else. M23Edit: I have now found a definitive MS statement that combos do not have that functionality. If you must use a tab then my only suggestion is creating your own combo. I will see what I can do this afternoon. Edited April 4, 2014 by Melba23 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 Link to comment Share on other sites More sharing options...
Anomalous Posted April 4, 2014 Author Share Posted April 4, 2014 @ JLogan3o13 yes, i have to use @TAB . i tried using spaces but i can not align the various list items in the right way. here's an example, using 2 and 3 and more spaces the is line one create big boss zing zong zang creepy crawlers i need that all the parts be seen on the same vertical line. you can see that thay are not. why ? it does not metter, i just need it that way and cant find the right way to do that @ Melba23 thank you for trying, if u'll find an answer, i'll be glad to know, Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 4, 2014 Moderators Share Posted April 4, 2014 Anomalous,I found an old script I could quickly modify: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiListBox.au3> Global $aTabs[4] = [3, 100, 200, 300] Global $fShow = False, $fClick = False $hGUI = GUICreate("Example", 500, 500) $cInput = GUICtrlCreateInput("", 10, 10, 180, 20) $cButton = GUICtrlCreateButton("v", 190, 10, 20, 20) GUISetState(@SW_SHOW, $hGUI) ; Create child GUI to hold list $hGUI_Child = GUICreate("Child", 200, 200, 10, 30, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) $cList = GUICtrlCreateList("", 0, 0, 200, 200, BitOR($WS_BORDER, $WS_VSCROLL, $LBS_USETABSTOPS)) GUICtrlSetResizing($cList, $GUI_DOCKAUTO) ; List resizes with GUI ; Set tab stops _GUICtrlListBox_SetTabStops($cList, $aTabs) ; Add data GUICtrlSetData($cList, "a|zaa" & @TAB & "zoo|b|c|d|bla|bla") GUISetState(@SW_HIDE, $hGUI_Child) GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton Switch $fShow Case False GUISetState(@SW_SHOW, $hGUI_Child) $fShow = True Case True GUISetState(@SW_HIDE, $hGUI_Child) $fShow = False EndSwitch EndSwitch ; If list has been clicked If $fClick Then $fClick = False GUICtrlSetData($cInput, GUICtrlRead($cList)) GUISetState(@SW_HIDE, $hGUI_Child) $fShow = False EndIf WEnd Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg ; Check it is the correct list If $lParam = GUICtrlGetHandle($cList) Then ; If new item selected If BitShift($wParam, 16) = $LBN_SELCHANGE Then $fClick = True EndIf EndIf EndFunc ;==>_WM_COMMANDAny use? 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 Link to comment Share on other sites More sharing options...
Anomalous Posted April 4, 2014 Author Share Posted April 4, 2014 @ Melba23 well, it does display zaa zoo and not zaazoo but its not a real combobox ... right ? maybe i can modify your code to be more comboboxy .. and have it my way heheheheh thanks again 4 trying and if ya do find some sort of answer, please share. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 4, 2014 Moderators Share Posted April 4, 2014 Anomalous, but its not a real comboboxAs I pointed out above, MS state quite clearly that "real" combos do not have the functionality to expand tabs, so something like this is probably as good as you will get. By all means modify the example code as much as you wish - anything I post here is free to use. M23 Skysnake 1 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 Link to comment Share on other sites More sharing options...
Anomalous Posted April 4, 2014 Author Share Posted April 4, 2014 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