System.Windows.Forms.ComboBox.SelectedIndex Property

Gets or sets the index specifying the currently selected item.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.Browsable(false)]
public override int SelectedIndex { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

This property indicates the zero-based index of the currently selected item in the combo box list. Setting a new index raises the ComboBox.SelectedIndexChanged event.

ComboBox.SelectedIndex, ListControl.SelectedValue, and ListControl.FormattingEnabled are related as follows:

Note:

To deselect the currently selected item, set the ComboBox.SelectedIndex to -1. You cannot set the ComboBox.SelectedIndex of a System.Windows.Forms.ComboBox item to -1 if the item is a data-bound item.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0