Solved

Vb.net 2010 combobox not write

Posted on 2010-11-12
11
1,099 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
11 Comments
 
LVL 70

Accepted Solution

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

Author Comment

by:rflorencio
ID: 34121612
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 70

Expert Comment

by:Éric Moreau
ID: 34121895
I do not understand. the DropDownList setting will not allow user to input into the combo box. It forces to pick one item.
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

Author Comment

by:rflorencio
ID: 34122062
we are talking about the same control right? combobox ?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 34122502
yes.
0
 
LVL 17

Assisted Solution

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

Expert Comment

by:Zhaolai
ID: 34125074
See the screen shot below:
Screenshot.PNG
0
 
LVL 17

Expert Comment

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

Author Comment

by:rflorencio
ID: 34134872
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 70

Expert Comment

by:Éric Moreau
ID: 34135056
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
ID: 34135216
I'm so sorry, the code actually had this property set to dropdown.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 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