TextBox.SelectedText 屬性

定義

取得或設定文字方塊中目前選取項目的內容。Gets or sets the content of the current selection in the text box.

public:
 property System::String ^ SelectedText { System::String ^ get(); void set(System::String ^ value); };
public string SelectedText { get; set; }
member this.SelectedText : string with get, set
Public Property SelectedText As String

屬性值

文字方塊中目前選取的文字。The currently selected text in the text box.

備註

取得此屬性會傳回目前所選取文字的字串複本。Getting this property returns a string copy of the currently selected text. 設定這個屬性會以指定的字串取代目前的選取範圍。Setting this property replaces the current selection with the specified string.

適用於

另請參閱