Rediger

Del via


TextBoxBase.Cut Method

Definition

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

public:
 void Cut();
public void Cut ();
[System.Security.SecurityCritical]
public void Cut ();
member this.Cut : unit -> unit
[<System.Security.SecurityCritical>]
member this.Cut : unit -> unit
Public Sub Cut ()
Attributes

Examples

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

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

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

See also