TextBoxBase.Copy Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Copies the current selection of the text editing control to the Clipboard.
public:
void Copy();
public void Copy ();
[System.Security.SecurityCritical]
public void Copy ();
member this.Copy : unit -> unit
[<System.Security.SecurityCritical>]
member this.Copy : unit -> unit
Public Sub Copy ()
- Attributes
Examples
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
Remarks
A 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. A similar method, Cut, moves the current selection to the Clipboard and removes the selected text from the text editing control in the process.
Applies to
See also
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應