views:

517

answers:

4

Hi. I'd like to add a drop-down list to a Windows application. It will have two choices, neither of which are editable. What's the best control to use? Is it a combo box with the editing property set to No?

I'm using Visual Studio 2008.

+1  A: 

yourComboBox.DropDownStyle = ComboBoxStyle.DropDownList

JP
+3  A: 

I'd suggest taking a look at the Windows Vista User Experience Guide. It sounds like you might be better off with radio buttons, or, if it's an explicit on/off type of situation, using a check box. I think we'd really need more info, though.

Sam Erwin
Yes, I think radio-buttons would actually work better. Thanks!
Eric Ness
A: 

Set the DropDownStyle property to DropDownList.

See http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.dropdownstyle(VS.80).aspx

Nikki9696
A: 

The combobox in winforms doubles as a uneditable drop down list by changing the DropDownStyle property to "DropDownList": I don't think there is a separate drop down list control.