Link to home
Start Free TrialLog in
Avatar of MTroutwine
MTroutwineFlag for United States of America

asked on

Move Item To Top Of ComboBox

I am working with a combobox that is sorted.  I want to add an item after the sorted items are entered that will be at the top of the combobox... like NONE.

I don't want to use a space or an underscore to move it to the top... anyway to do this???

Thanks!
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

No.  The only other way would be for you to maintain the sorted items and leave the Sort property = False.

Anthony
Indeed, sort the items first and then add them to the combo box is the only way of doing this.
'with.sorted is true
   
    Combo1.AddItem "Bunk"
    Combo1.AddItem "Abunk"
    Combo1.AddItem "NONE", 0
note that your combo has .sorted=true in properties.
deighton,

You are right.  I overlooked that solution.

Anthony
i am late!
..so did I, it was an accident, I was trying to change sorted to .false then add it to the top - you can't change to .false, but adding it to the top still seems to work.
ASKER CERTIFIED SOLUTION
Avatar of rspahitz
rspahitz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MTroutwine

ASKER

Sorry for the delay on this... I used your idea of "(None)".  Works fine now.
Glad you liked the idea (even if it came from Microsoft), and thanks for the "A" grade.