Solved

Move Item To Top Of ComboBox

Posted on 2002-05-02
10
225 Views
Last Modified: 2008-02-26
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!
0
Comment
Question by:MTroutwine
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6986163
No.  The only other way would be for you to maintain the sorted items and leave the Sort property = False.

Anthony
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6986195
Indeed, sort the items first and then add them to the combo box is the only way of doing this.
0
 
LVL 18

Expert Comment

by:deighton
ID: 6986226
'with.sorted is true
   
    Combo1.AddItem "Bunk"
    Combo1.AddItem "Abunk"
    Combo1.AddItem "NONE", 0
0
 
LVL 18

Expert Comment

by:deighton
ID: 6986230
note that your combo has .sorted=true in properties.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6986239
deighton,

You are right.  I overlooked that solution.

Anthony
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6986392
i am late!
0
 
LVL 18

Expert Comment

by:deighton
ID: 6986412
..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.
0
 
LVL 22

Accepted Solution

by:
rspahitz earned 150 total points
ID: 6986507
Alternately you can do what Microsoft did ni its properties listing (with name, custom, etc.) and surround it with parentheses:  "(None)"

This will also reinforce the idea that this is not part of the dataset.
0
 
LVL 3

Author Comment

by:MTroutwine
ID: 7016464
Sorry for the delay on this... I used your idea of "(None)".  Works fine now.
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7016714
Glad you liked the idea (even if it came from Microsoft), and thanks for the "A" grade.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now