TextBoxBase.Cut 方法

定义

从文本编辑控件中删除当前选定内容,并将其复制到 ClipboardRemoves the current selection from the text editing control and copies it to the Clipboard.

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

示例

下面的示例演示如何使用 Cut 方法删除 TextBox 控件中选定的文本。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

注解

剪切操作从文本编辑控件中删除当前所选内容,并将其复制到 ClipboardA 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. Copy的类似方法会将当前选定内容复制到剪贴板,但不会从文本编辑控件中删除选定的文本。A similar method, Copy, copies the current selection to the Clipboard, but does not remove the selected text from the text editing control.

安全性

SecurityCriticalAttribute
完全信任继承者。for full trust for inheritors. 部分受信任的代码不能继承此成员。This member cannot be inherited by partially trusted code.

适用于

另请参阅