共用方式為


TextBoxBase.SelectAll 方法

定義

選取文字編輯控制項的所有內容。

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

範例

下列範例示範如何使用 SelectAll 方法來選取控制項的所有內容 TextBox

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

適用於