Solved

Vb.net 2010 combobox not write

Posted on 2010-11-12
11
1,062 Views
Last Modified: 2012-05-10
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
.....
0
Comment
Question by:rflorencio
  • 4
  • 4
  • 3
11 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 400 total points
Comment Utility
set the DropDownStyle property to DropDownList
0
 

Author Comment

by:rflorencio
Comment Utility
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
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
I do not understand. the DropDownList setting will not allow user to input into the combo box. It forces to pick one item.
0
 

Author Comment

by:rflorencio
Comment Utility
we are talking about the same control right? combobox ?
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
yes.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 17

Assisted Solution

by:Zhaolai
Zhaolai earned 100 total points
Comment Utility
Set the combobox's AutoCompleteMode = Suggest, and AutoCompleteSource=ListItems, either at design time or in the code.
0
 
LVL 17

Expert Comment

by:Zhaolai
Comment Utility
See the screen shot below:
Screenshot.PNG
0
 
LVL 17

Expert Comment

by:Zhaolai
Comment Utility
Ah, if you do not want user to write in the combobox, @emoreau already answered your question. :=)
0
 

Author Comment

by:rflorencio
Comment Utility
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
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
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
 

Author Closing Comment

by:rflorencio
Comment Utility
I'm so sorry, the code actually had this property set to dropdown.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

11 Experts available now in Live!

Get 1:1 Help Now