通过


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。 如果设置为该SelectionMode属性ListBoxSelectionMode.MultiExtended,则此属性返回第一个选定项的文本。 SelectionMode如果未设置为SelectionMode.None该属性ListBox,则此属性返回第一个选定项的文本。

适用于