Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem when loading ComboBox list at Runtime

Status
Not open for further replies.

Ramya1

Programmer
Oct 11, 2002
40
US
If i load the combobox's list at design time, i'm able to go to directly to a city OK-OKLAHOMA by directly typing OK. But i've to change the original functionality to load the list in combobox at runtime depending on other criteria. This makes the ability to go directly to a city i want. For example, now if i press OK it seems to recognize only the first character - 'O' and goes to OH-OHIO. It doesn't take 'OK' into account and go to OK-OKLAHOMA. If i'm already in OHIO and i press 'O' again it goes to OK-OKLAHOMA.

The list has items like this

AK-Alaska
AL-Alabama
AR-Arkansas

Is there a workaround to get the original ability back?

Thanks in advance for your help.
Ramiya.
 
If you set the Property value Sorted = True that should do it.
 
But, i don't want the sorted property to be true since i want to group the cities by country. Is there any other way other than sorting?
 
I encountered a similar problem with a previous employer...

My (very painful) solution was to write code into the keypress event for a textbox. This code basically said using what it is in the combobox right now, find the first value in the data that matches, and then determine the missing text. Once this is done, add the missing text, but select it.

That means that when the user pressed another key, that character would replace the selected text, and the search would run once more...

Hope that's useful!
Martin
 
Thanks for the workaround martin. I didn't think of that possibility. I'll work on it. I appreaciate your help.

Thanks.
Ramiya.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top