-1

I'm using visual studio 2010 which supports .Net 4 and doesn't have support for a Drop Down List. I am trying to get the same effect through a combobox by disabling the ability for a user to enter free-form text, but not sure how. How can I accomplish this goal?

ADDITIONAL INFO

reza
  • 1,329
  • 2
  • 22
  • 37

2 Answers2

4

Visual Studio 2010 does have support for Drop Down Lists when using .Net 4. It is actually part of the same control you're already using (the Combo Box), you just have to set the property for it.

Change the DropDownStyle property to DropDownList.

Or do it programmatically with:

comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;

Check out the MSDN on ComboBoxes: ComboBox.DropDownStyle Property

awudoin
  • 541
  • 2
  • 8
0

If I understand what you mean, you want to add this code to your .cs file

enter image description here

I want you to type it out, cause it's good practice. If this isn't what you mean...well than you need to explain your question better.