Editare

Partajați prin


ToolStripComboBox.SelectedItem Property

Definition

Gets or sets currently selected item in the ToolStripComboBox.

public:
 property System::Object ^ SelectedItem { System::Object ^ get(); void set(System::Object ^ value); };
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.Browsable(false)]
public object SelectedItem { get; set; }
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.Browsable(false)]
public object? SelectedItem { get; set; }
[<System.ComponentModel.Bindable(true)>]
[<System.ComponentModel.Browsable(false)>]
member this.SelectedItem : obj with get, set
Public Property SelectedItem As Object

Property Value

The object that is the currently selected item or null if there is no currently selected item.

Attributes

Remarks

When you set the SelectedItem property to an object, the ToolStripComboBox 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 ToolStripComboBox 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.

Applies to