ComboBox.DropDownStyle Property

 

Gets or sets a value specifying the style of the combo box.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

member DropDownStyle : ComboBoxStyle with get, set

Property Value

Type: System.Windows.Forms.ComboBoxStyle

One of the ComboBoxStyle values. The default is DropDown.

Exception Condition
InvalidEnumArgumentException

The assigned value is not one of the ComboBoxStyle values.

The DropDownStyle property specifies whether the list is always displayed or whether the list is displayed in a drop-down. The DropDownStyle property also specifies whether the text portion can be edited. See ComboBoxStyle for the available settings and their effects. There is no setting to always display the list and disallow entering a new value. To display a list to which no new values can be added, use a ListBox control.

The following code example demonstrates setting the DropDownStyle property. To run the example, paste the following code in a form. Call the InitializeComboBox method in the form's constructor or Load event.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: