| | | Forum Member
       
Group: Forum Members Last Login: 12/30/2008 10:42:31 AM Posts: 96, Visits: 154 |
| | I want to sort a combobox, but if I use the sort property it will sort like: 1 11 13 2 22 30 And I want to have it like: 1 2 11 13 22 30 How can I do that? |
| | | | Junior Member
       
Group: Forum Members Last Login: 9/2/2008 9:32:27 AM Posts: 21, Visits: 335 |
| | Hello, Try the given code snippet. This should work for you. <CODE> Dim arr(Me.ComboBox1.Items.Count - 1) As IntegerDim i As IntegerFor i = 0 To Me.ComboBox1.Items.Count - 1arr(i) = Me.ComboBox1.Items(i)NextArray.Sort(arr) Me.ComboBox1.Items.Clear()For i = 0 To arr.Length - 1 Me.ComboBox1.Items.Add(arr(i))Next</CODE> Regards,
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com |
| | | | Forum Member
       
Group: Forum Members Last Login: 12/30/2008 10:42:31 AM Posts: 96, Visits: 154 |
| | Thanks a lot It's working, but you would expect it would be a standerd propertie Kiter |
| |
|
|