ToolStripComboBox.SelectedItem 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定目前在 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
屬性值
目前所選取項目的物件;如果目前沒有選取的項目,則為 null
。
- 屬性
備註
當您將 SelectedItem 屬性設定為 物件時,會 ToolStripComboBox 嘗試將該物件設為清單中目前選取的物件。 如果在清單中找到物件,則會顯示在 的 ToolStripComboBox 編輯部分,而 SelectedIndex 屬性會設定為對應的索引。 如果物件不存在於清單中,則 SelectedIndex 屬性會保留在其目前值。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應