次の方法で共有


ListBox.Text プロパティ

定義

ListBoxで現在選択されている項目のテキストを取得または検索します。

public:
 virtual property System::String ^ Text { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Bindable(false)]
[System.ComponentModel.Browsable(false)]
public override string Text { get; set; }
[<System.ComponentModel.Bindable(false)>]
[<System.ComponentModel.Browsable(false)>]
member this.Text : string with get, set
Public Overrides Property Text As String

プロパティ値

コントロールで現在選択されている項目のテキスト。

属性

注釈

このプロパティの値が文字列値に設定されている場合、 ListBox は、指定されたテキストに一致する ListBox 内の項目を検索し、項目を選択します。 このプロパティを使用して、 ListBoxで現在選択されている項目を決定することもできます。 ListBoxSelectionMode プロパティがSelectionMode.MultiExtendedに設定されている場合、このプロパティは最初に選択した項目のテキストを返します。 ListBoxSelectionMode プロパティが SelectionMode.None に設定されていない場合、このプロパティは最初に選択した項目のテキストを返します。

適用対象