Vb.net 2010 combobox not write

I would like when have a combobox, press a key for ex. "p" in the following example, and automatically combobox show the first item beginning with "p" (no problem). But also liked prevent user not write anything in the combobox.

France
Portugal
Usa
.....
rflorencioAsked:
Who is Participating?
 
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
set the DropDownStyle property to DropDownList
0
 
rflorencioAuthor Commented:
the main problem for me is prevent user to write in combobox,  changing property of combobox behavior is similar, or do I have to change other property.
0
 
Éric MoreauSenior .Net ConsultantCommented:
I do not understand. the DropDownList setting will not allow user to input into the combo box. It forces to pick one item.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
rflorencioAuthor Commented:
we are talking about the same control right? combobox ?
0
 
Éric MoreauSenior .Net ConsultantCommented:
yes.
0
 
ZhaolaiConnect With a Mentor Commented:
Set the combobox's AutoCompleteMode = Suggest, and AutoCompleteSource=ListItems, either at design time or in the code.
0
 
ZhaolaiCommented:
See the screen shot below:
Screenshot.PNG
0
 
ZhaolaiCommented:
Ah, if you do not want user to write in the combobox, @emoreau already answered your question. :=)
0
 
rflorencioAuthor Commented:
I still can write in the combobox which can be? I have a bindingsource to this control, it may be?
Img.jpg
Img2.jpg
0
 
Éric MoreauSenior .Net ConsultantCommented:
can you try to provide items?

how do you bind your combo because I see that your DataSource property is empty.

are you setting the DropDownStyle elsewhere in code?
0
 
rflorencioAuthor Commented:
I'm so sorry, the code actually had this property set to dropdown.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.