次の方法で共有


ListBox.Text プロパティ

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

Overrides Public Property Text As String
[C#]
public override string Text {get; set;}
[C++]
public: __property String* get_Text();public: __property void set_Text(String*);
[JScript]
public override function get Text() : String;public override function set Text(String);

プロパティ値

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

解説

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

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET

参照

ListBox クラス | ListBox メンバ | System.Windows.Forms 名前空間