Clipboard in WPF DOCX Editor

29 Aug 20261 minute to read

The WPF DOCX Editor (SfRichTextBoxAdv) takes advantage of the clipboard support and allows you to copy or paste contents to and from the clipboard in the following formats.

  • Rich text format.

  • Text.

  • Image.

UI commands to access clipboard operations

The following code example demonstrates how to bind commands for accessing clipboard operations.

<!-- Binds button to the CutCommand -->
<Button Content="Cut" Command="RichTextBoxAdv:SfRichTextBoxAdv.CutCommand" CommandTarget="{Binding ElementName=richTextBoxAdv}" />
<!-- Binds button to the CopyCommand -->
<Button Content="Copy" Command="RichTextBoxAdv:SfRichTextBoxAdv.CopyCommand" CommandTarget="{Binding ElementName=richTextBoxAdv}" />
<!-- Binds button to the PasteCommand -->
<Button Content="Paste" Command="RichTextBoxAdv:SfRichTextBoxAdv.PasteCommand" CommandTarget="{Binding ElementName=richTextBoxAdv}" />

In order to cut, copy, or paste, the standard keyboard shortcuts such as CTRL+X, CTRL+C, and CTRL+V can also be used.

You can refer to our WPF DOCX Editor feature tour page for its groundbreaking feature representations. You can also explore our WPF DOCX Editor example to know how to render and configure the editing tool.

See also