Clipboard in WPF DOCX Editor

18 Aug 20261 minute to read

The WPF RichTextBox (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}" />

NOTE

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

NOTE

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

See also