Ghost21 Posted January 24, 2008 Share Posted January 24, 2008 Is there a way to sort a combo box contents.. Via numbers or letters ??? Link to comment Share on other sites More sharing options...
Monamo Posted January 24, 2008 Share Posted January 24, 2008 Is there a way to sort a combo box contents.. Via numbers or letters ???Using the GUICtrlCreateCombo() "style" parameter, $CBS_SORT - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup] Link to comment Share on other sites More sharing options...
Ghost21 Posted January 24, 2008 Author Share Posted January 24, 2008 Using the GUICtrlCreateCombo() "style" parameter, $CBS_SORTI thought that worked only if its being typed in... Sorry should have been more specific. It's being queried from an SQL database and sent to it... Link to comment Share on other sites More sharing options...
james3mg Posted January 24, 2008 Share Posted January 24, 2008 I thought that worked only if its being typed in... Sorry should have been more specific. It's being queried from an SQL database and sent to it...Should still work, I think.Anyway, can't you add a Order By parameter to your sql SELECT query? "There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110 Link to comment Share on other sites More sharing options...
Ghost21 Posted January 24, 2008 Author Share Posted January 24, 2008 Should still work, I think.Anyway, can't you add a Order By parameter to your sql SELECT query?hmmm.. I will have to look that up...Thanks for the tip.. Link to comment Share on other sites More sharing options...
Cyri Posted February 24, 2009 Share Posted February 24, 2009 (edited) hmmm.. I will have to look that up...Thanks for the tip..I'm running into a similar situation. I'm using logparser to populate the combo box. I'm already using an Order By in the LogParser query, but it's case sensitive. The $CBS_SORT doesn't work. As stated before, that will only work for ones you type into the drop down.Any other suggestions? I haven't been able to get Log Parser to be case insenstive when sorting. Edited February 24, 2009 by Cyri Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 24, 2009 Moderators Share Posted February 24, 2009 Hi,Why not load the returned values into an array and then sort the array (_ArraySort). Getting the array into the combo is trivial:For $i = 1 To $aList[0] $sList &= $aList[$i] & "|" Next $hCombo = GUICtrlCreateCombo (...) GUICtrlSetData(-1, $sList, "")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...
Cyri Posted February 24, 2009 Share Posted February 24, 2009 Hi, Why not load the returned values into an array and then sort the array (_ArraySort). Getting the array into the combo is trivial:For $i = 1 To $aList[0] $sList &= $aList[$i] & "|" Next $hCombo = GUICtrlCreateCombo (...) GUICtrlSetData(-1, $sList, "") M23 I was hoping to avoid that extra step, but that sounds like the way to go. Thanks. 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