Solved

Limiting ComboBox to Collection Items

Posted on 2008-10-11
3
176 Views
Last Modified: 2010-04-23
Hi, I' using VB 2005, WinForm. I have a ComboBox on my Form the has three items in its "Items" collection (i.e ItemA, ItemB and ItemC).

I want to make sure my user can only choose from these three values and cannot add his/her own value(s) to the text property of the ComboBox. In other words somewhat like ReadOnly, but the ComboBox does not have a ReadOnly property.

Can someone suggest a way to prevent the user from adding their own values?

Thanks,
Fulano
0
Comment
Question by:Mr_Fulano
  • 2
3 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
ID: 22695131
just change the combo style from DropDown to DropDownList, do not set the ReadOnly property
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 22695136
the Property name is DropDownStyle
0
 

Author Comment

by:Mr_Fulano
ID: 22695521
Hi jaime_olivares, yes... that worked fine. Thank you very much!

Fulano
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
A short film showing how OnPage and Connectwise integration works.

932 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

8 Experts available now in Live!

Get 1:1 Help Now