• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • Last Modified:

Limiting ComboBox to Collection Items

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
Mr_Fulano
Asked:
Mr_Fulano
  • 2
1 Solution
 
Jaime OlivaresSoftware ArchitectCommented:
just change the combo style from DropDown to DropDownList, do not set the ReadOnly property
0
 
Jaime OlivaresSoftware ArchitectCommented:
the Property name is DropDownStyle
0
 
Mr_FulanoAuthor Commented:
Hi jaime_olivares, yes... that worked fine. Thank you very much!

Fulano
0

Featured Post

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!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now