Solved

Vb.net 2010 combobox not write

Posted on 2010-11-12
11
1,107 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

622 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