Solved

Limiting ComboBox to Collection Items

Posted on 2008-10-11
3
175 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
Comment Utility
just change the combo style from DropDown to DropDownList, do not set the ReadOnly property
0
 
LVL 55

Expert Comment

by:Jaime Olivares
Comment Utility
the Property name is DropDownStyle
0
 

Author Comment

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

Fulano
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
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 this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
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…

763 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

12 Experts available now in Live!

Get 1:1 Help Now