ComboBox Class

Displays a combobox that contains a drop-down list of items.

Namespace: elsystem.windows.forms

Properties

   Additional properties, methods, and events are described in the classes listed under Inheritance Hierarchy (see below).

  Name Type Description
Public property Count int Gets the number of items in the combobox list.
Public property DropDownHeight int Gets or sets the height of the combobox.
Public property DropDownStyle enum Gets or sets the style of the combobox. See ComboBoxStyle for a list of possible values.
Public property DropDownWidth int Gets or sets the width of the combobox.
Public property FlatStyle enum Gets or sets the flat style appearance of the combobox.  See FlatStyle for a list of possible values.
Public property Item [index ] string Gets or sets the item at the specified index.
Public property SelectedIndex int Gets or sets the index of the selected combobox item.
Public property SelectedItem object Gets the selected item from the ComboBox list.
Public property SelectedText string Gets or sets the text that is selected in the editable portion of a combobox.
Public property Sorted bool Sets or gets a value indicating if combobox items are sorted.

   Additional properties, methods, and events are described in the classes listed under Inheritance Hierarchy (see below).

Methods
  Name Description
Public property AddItem(string) Adds a new combobox item using the provided text string.
Public property Clear Clears the contents from the combobox.
Public property Create Initializes a new instance of a combobox.  
Public property Create(text,width,height) Initializes a new instance of a combobox.  Parameters include the default Text to appear in the combo box followed the Width and Height of the control.
Public property FindStringvalue) Finds the first item in the combo box that starts with the specified string value. The search is not case sensitive.
Public property FindString(value,index) Finds the first item in the combo box that starts with the specified string value starting after the specified index. The search is not case sensitive.
Public property FindStringExact(value) Finds the first item in the comb box that exactly matches the specified string value. The search is case sensitive.
Public property GetItem(index) Gets the item at the specified index position.
Public property RemoveItem(index) Removes an item from the combo box at the index position.
Public property SetItem(index, value) Sets the item at the specified index position to the specified string value.
Events
  Name Description
Public event

DropDown

Occurs when the drop down portion of the combobox is shown. See EventArgs for the properties returned the handler's args parameter.

Public event

KeyDown

Occurs when a combobox is selected and a key on the keyboard is pressed down. See KeyEventArgs for the properties returned by the handler's args parameter.

Public event

KeyPress

Occurs when a combobox is selected and a key on the keyboard is pressed. See KeyEventArgs for the properties returned by the handler's args parameter.

Public event

KeyUp

Occurs when a combobox is selected and a key on the keyboard is released. See KeyEventArgs for the properties returned by the handler's args parameter.

Public event

SelectedIndexChanged

Occurs when a combobox item is selected or changed. See EventArgs for the properties returned by the handler's args parameter.

Public event

TextChanged

Occurs when the value of the Text property changes. See EventArgs for the properties returned by the handler's args parameter.