TextBoxBase.Cut Method

Definition

Removes the current selection from the text editing control and copies it to the Clipboard.

C#
public void Cut();
C#
[System.Security.SecurityCritical]
public void Cut();
Attributes

Examples

The following example demonstrates how to use the Cut method to delete the text that is selected in a TextBox control.

C#
private void cutText(object sender, RoutedEventArgs e)
{
    myTextBox.Cut();
}

Remarks

A cut operation removes the current selection from the text editing control and copies it to the Clipboard. Note that the selected text is removed (cut) from the text editing control in the process. A similar method, Copy, copies the current selection to the Clipboard, but does not remove the selected text from the text editing control.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also