Back to Devexpress

RichEditControl.Paste() Method

windowsforms-devexpress-dot-xtrarichedit-dot-richeditcontrol-abc03b51.md

latest3.3 KB
Original Source

RichEditControl.Paste() Method

Inserts the contents of the Clipboard at the selection.

Namespace : DevExpress.XtraRichEdit

Assembly : DevExpress.XtraRichEdit.v25.2.dll

NuGet Package : DevExpress.Win.RichEdit

Declaration

csharp
public void Paste()
vb
Public Sub Paste

Example

The following code pastes text from the system Clipboard into the current document position (the Document.CaretPosition). The current RichEditControl instance is passed to the BarItem.ItemClick event handler using the BarItem.Tag property.

View Example

csharp
static void buttonCustomAction_ItemClick_PasteTextFromClipboard(object sender, ItemClickEventArgs e) {
    RichEditControl richEdit = e.Item.Tag as RichEditControl;
    richEdit.Paste();
}
vb
Private Shared Sub buttonCustomAction_ItemClick_PasteTextFromClipboard(ByVal sender As Object, ByVal e As ItemClickEventArgs)
    Dim richEdit As RichEditControl = TryCast(e.Item.Tag, RichEditControl)
    richEdit.Paste()
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Paste() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-richeditcontrol-common-api/CS/RichEditAPISample/CodeExamples/RichEditControlActions.cs#L159

csharp
RichEditControl richEdit = e.Item.Tag as RichEditControl;
    richEdit.Paste();
}

winforms-richeditcontrol-common-api/VB/RichEditAPISample/CodeExamples/RichEditControlActions.vb#L165

vb
Dim richEdit As RichEditControl = TryCast(e.Item.Tag, RichEditControl)
    richEdit.Paste()
End Sub

See Also

RichEditControl Class

RichEditControl Members

DevExpress.XtraRichEdit Namespace