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

  • Thread starter Thread starter John Smith
  • Start date Start date
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?
 
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
 
Back
Top