Solved

Limiting ComboBox to Collection Items

Posted on 2008-10-11
3
177 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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 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