TextBoxBase.SelectAll 方法

定义

选择文本编辑控件的全部内容。Selects all the contents of the text editing control.

public:
 void SelectAll();
public void SelectAll ();
member this.SelectAll : unit -> unit
Public Sub SelectAll ()

示例

下面的示例演示如何使用SelectAll方法选择TextBox控件的所有内容。The following example demonstrates how to use the SelectAll method to select all the contents of a TextBox control.

private void selectAll(object sender, RoutedEventArgs e)
{
    myTextBox.SelectAll();
}
Private Sub selectAll(ByVal sender As Object, ByVal e As RoutedEventArgs)
    myTextBox.SelectAll()
End Sub

适用于