Back to Devexpress

RichEditControl Class

wpf-devexpress-dot-xpf-dot-richedit.md

latest9.0 KB
Original Source

RichEditControl Class

Represents a RichEdit control which is a container for the rich-text document providing all the necessary functionality.

Namespace : DevExpress.Xpf.RichEdit

Assembly : DevExpress.Xpf.RichEdit.v25.2.dll

NuGet Package : DevExpress.Wpf.RichEdit

Declaration

csharp
[DXLicenseWpf]
public class RichEditControl :
    Control,
    IGestureClient,
    IBasePrintable,
    IPrintingTarget,
    IWin32Window,
    IDisposable,
    IToolTipControlClient,
    ILogicalOwner,
    IInputElement,
    IOfficeFontSizeProvider,
    IRichEditDocumentServer,
    IBatchUpdateable,
    IServiceContainer,
    IServiceProvider,
    IRichEditControl,
    ICommandAwareControl<RichEditCommandId>,
    IInnerRichEditControlOwner,
    IInnerRichEditDocumentServerOwner,
    INotifyPropertyChanged,
    IRichEditDocumentLayoutProvider
vb
<DXLicenseWpf>
Public Class RichEditControl
    Inherits Control
    Implements IGestureClient,
               IBasePrintable,
               IPrintingTarget,
               IWin32Window,
               IDisposable,
               IToolTipControlClient,
               ILogicalOwner,
               IInputElement,
               IOfficeFontSizeProvider,
               IRichEditDocumentServer,
               IBatchUpdateable,
               IServiceContainer,
               IServiceProvider,
               IRichEditControl,
               ICommandAwareControl(Of RichEditCommandId),
               IInnerRichEditControlOwner,
               IInnerRichEditDocumentServerOwner,
               INotifyPropertyChanged,
               IRichEditDocumentLayoutProvider

The following members return RichEditControl objects:

Remarks

The RichEditControl is a word processing viewer. It processes text with any text direction. The RichEditControl ships with an integrated ribbon that allows end users to perform basic operations.

The Document and the SubDocument interfaces are the entry points for a RichEdit document. Use the IRichEditControl.Document property to access the Document instance.

Refer to the RichEditControl Document section for more information about the available elements and how to manage them.

You can provide a document source for the RichEditControl using the RichEditControl.DocumentSource property, or load a document in code behind using the RichEditControl.LoadDocument() method overloads.

Check the WPF Rich Text Editor Examples section for code examples used to solve different word processing tasks.

The RichEditControl provides control-specific options. Use the RichEditControl.BehaviorOptions property to retrieve settings used to control editor operations (save, print,clipboard operations, etc.)

The RichEditControl.DocumentCapabilitiesOptions property provides access to options used to control the use of document elements.

The Visual Elements section describes the RichEditControl’s interface and built-in dialogs.

The code sample below creates a new Rich Text Editor in XAML and provides a document source for it. Refer to the Get Started with WPF Rich Text Editor section for step-by-step tutorials on how to create a Rich Text Editor application and provide it with a command UI.

xaml
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApplication1"
        xmlns:dxre="http://schemas.devexpress.com/winfx/2008/xaml/richedit"
        x:Class="WpfApplication1.MainWindow"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <dxre:RichEditControl CommandBarStyle="Ribbon"
                              DocumentSource="pack://application:,,,/WpfApplication1;component/Document.docx"/>
    </Grid>
</Window>

The following code snippets (auto-collected from DevExpress Examples) contain references to the RichEditControl class.

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.

wpf-richedit-document-api/CS/DXRichEditControlAPISample/MainWindow.xaml#L30

xml
<dx:DXTabItem Header="CS" Width="250">
    <dxre:RichEditControl x:Name="richEditControlCS" ActiveViewType="Simple" />
</dx:DXTabItem>

wpf-spreadsheet-chart-api/CS/SpreadsheetWPFChartAPISamples/MainWindow.xaml#L31

xml
<dx:DXTabItem Header="CS" Width="250">
    <dxre:RichEditControl x:Name="richEditControlCS" ActiveViewType="Simple" />
</dx:DXTabItem>

wpf-spreadsheet-pivot-table-api-examples/CS/SpreadsheetWPFPivotTableExamples/MainWindow.xaml#L31

xml
<dx:DXTabItem Header="CS" Width="250">
    <dxre:RichEditControl x:Name="richEditControlCS" ActiveViewType="Simple" />
</dx:DXTabItem>

dxrichedit-for-wpf-how-to-implement-progress-indicator/CS/MainWindow.xaml#L19

xml
<dx:DXTabItem Header="Template">
    <dxre:RichEditControl Name="richEditControl1" Loaded="richEditControl1_Loaded" MailMergeStarted="richEditControl1_MailMergeStarted" MailMergeFinished="richEditControl1_MailMergeFinished" MailMergeRecordStarted="richEditControl1_MailMergeRecordStarted" MailMergeRecordFinished="richEditControl1_MailMergeRecordFinished" />
</dx:DXTabItem>

wpf-richedit-use-docvariable-fields/CS/MainWindow.xaml#L23

xml
<dx:DXTabItem Header="Template">
    <dxre:RichEditControl Name="richEditControl1" Loaded="richEditControl1_Loaded" MailMergeStarted="richEditControl1_MailMergeStarted" MailMergeFinished="richEditControl1_MailMergeFinished" MailMergeRecordStarted="richEditControl1_MailMergeRecordStarted" MailMergeRecordFinished="richEditControl1_MailMergeRecordFinished" />
</dx:DXTabItem>

Inheritance

Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control RichEditControl

See Also

RichEditControl Members

WinForms Rich Text Editor

Get Started with WinForms Rich Text Editor

DevExpress.Xpf.RichEdit Namespace