This documentation is archived and is not being maintained.

ComboBox.SelectedItem Property

Gets or sets currently selected item in the ComboBox.

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

<BindableAttribute(True)> _
Public Property SelectedItem As Object
Dim instance As ComboBox
Dim value As Object

value = instance.SelectedItem

instance.SelectedItem = value
/** @property */
public Object get_SelectedItem ()

/** @property */
public void set_SelectedItem (Object value)

public function get SelectedItem () : Object

public function set SelectedItem (value : Object)

Not applicable.

Property Value

The object that is the currently selected item or a null reference (Nothing in Visual Basic) if there is no currently selected item.

When you set the SelectedItem property to an object, the 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 ComboBox and the SelectedIndex property is set to the corresponding index. If the object does not exist in the list, the SelectedIndex property is left at its current value.


The ComboBox class searches for the specified object by using the IndexOf method. This method uses the Equals method to determine equality.

The following code example shows the usage of the SelectedIndex and the SelectedItem properties. The example is part of a complete code example in the ComboBox class overview.

Private Sub showSelectedButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim selectedIndex As Integer
    selectedIndex = comboBox1.SelectedIndex
    Dim selectedItem As Object
    selectedItem = comboBox1.SelectedItem

    MessageBox.Show("Selected Item Text: " & selectedItem.ToString() & Microsoft.VisualBasic.Constants.vbCrLf & _
                        "Index: " & selectedIndex.ToString())
End Sub

private void showSelectedButton_Click(Object sender, System.EventArgs e)
    int selectedIndex = comboBox1.get_SelectedIndex();
    Object selectedItem = comboBox1.get_SelectedItem();
    MessageBox.Show("Selected Item Text: " + selectedItem.ToString() 
        + "\n" + "Index: " + ((Int32)selectedIndex).ToString());
} //showSelectedButton_Click

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0