HOW TO: Avoid *ComboBox DropDownStyle = DropDown* change the textin the textbox?

J

John Smith

HOW TO: Avoid *ComboBox DropDownStyle = DropDown* change the text in the
textbox?

I am using a ComboBox to suggest and not to impose a list of words
DropDownStyle = DropDown

when setting the ComboBox.Text to a non capitalized word that exists
capitalized in the ComboBox list, the text shown is the one from the list

Ex:
ComboBox1.Items.AddRange(Split("Mary,John,Peter", ","))
ComboBox1.Text = "mary"
will display
"Mary" instead of "mary"

How to avoid the automatic change?
 
J

John Smith

John said:
HOW TO: Avoid *ComboBox DropDownStyle = DropDown* change the text in the
textbox?

I am using a ComboBox to suggest and not to impose a list of words
DropDownStyle = DropDown

when setting the ComboBox.Text to a non capitalized word that exists
capitalized in the ComboBox list, the text shown is the one from the list

Ex:
ComboBox1.Items.AddRange(Split("Mary,John,Peter", ","))
ComboBox1.Text = "mary"
will display
"Mary" instead of "mary"

How to avoid the automatic change?
I found a solution:

ComboBox1.Text = ""
If Structure1.Text <> "" Then ComboBox1.SelectedText = Structure1.Text

if you try to assign ComboBox1.SelectedText to Structure1.Text = Nothing
this will raise an error.

any other solutions are welcome
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top