TextBoxBase.Copy 方法

定義

將文字編輯控制項的目前選項文字複製到 ClipboardCopies the current selection of the text editing control to the Clipboard.

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

範例

下列範例示範如何使用Copy方法來複製TextBox在控制項中選取的文字。The following example demonstrates how to use the Copy method to copy the text that is selected in a TextBox control.

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

備註

複製作業會將選取的文字複製到ClipboardA copy operation copies the selected text to the Clipboard. 請注意, 選取的文字不會從進程的文字編輯控制項中移除。Note that the selected text is not removed from the text editing control in the process. 類似的方法Cut會將目前的選取範圍移Clipboard至, 並從進程中的文字編輯控制項移除選取的文字。A similar method, Cut, moves the current selection to the Clipboard and removes the selected text from the text editing control in the process.

安全性

SecurityCriticalAttribute
適用於繼承者的完全信任的。for full trust for inheritors. 部分信任的程式碼無法繼承這個成員。This member cannot be inherited by partially trusted code.

適用於

另請參閱