Solved

Limiting ComboBox to Collection Items

Posted on 2008-10-11
3
181 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
[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
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

630 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