System.Windows.Forms.ComboBox.SelectedItem Property

Gets or sets currently selected item in the System.Windows.Forms.ComboBox.


public object SelectedItem { set; get; }


Documentation for this section has not yet been entered.


When you set the ComboBox.SelectedItem property to an object, the System.Windows.Forms.ComboBox attempts to make that object the currently selected one in the list. If the object is found in the list, it is displayed in the edit portion of the System.Windows.Forms.ComboBox and the ComboBox.SelectedIndex property is set to the corresponding index. If the object does not exist in the list, the ComboBox.SelectedIndex property is left at its current value.


The System.Windows.Forms.ComboBox class searches for the specified object by using the System.Windows.Forms.ComboBox.ObjectCollection.IndexOf(object) method. This method uses the object.Equals(object) method to determine equality.


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