ComboBoxStyle.DropDownList
时间: 2023-08-27 12:06:59 浏览: 50
The ComboBoxStyle.DropDownList is a style of ComboBox control in .NET that allows the user to select an item from a pre-defined list of items. The DropDownList style only allows the user to select an item from the list and does not allow them to enter any other value.
When this style is set, the ComboBox control will display a list of available items when the drop-down button is clicked. The user can then select an item from the list, and the selected item will be displayed in the ComboBox. The DropDownList style is useful when you have a limited number of items to choose from, and you want to ensure that the user only selects one of these items.
To set the DropDownList style, you can set the ComboBox.DropDownStyle property to ComboBoxStyle.DropDownList. For example:
```
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
```
This will set the ComboBox control named comboBox1 to use the DropDownList style.