NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

TextBoxBase.SelectAll

Selects all text in the text box.

[Visual Basic]
Public Sub SelectAll()
[C#]
public void SelectAll();
[C++]
public: void SelectAll();
[JScript]
public function SelectAll();

Remarks

The following example uses TextBox, a derived class, to determine if any text is selected in the control. If no text is selected, a call is made to the SelectAll method before copying the contents of the control to the Clipboard. This example assumes that a TextBox has been created named Text1.

[Visual Basic]

Public Sub CopyAllText()
   ' Determine if any text is selected in the TextBox control.
   If Not Text1.SelectionLength > 0 Then
      ' Select all text in the text box.
      Text1.SelectAll
   End If
   ' Copy the contents of the control to the Clipboard
   Text1.Copy
End Sub

See Also

TextBoxBase Class | TextBoxBase Members | System.WinForms Namespace