Back to Devexpress

RichEditControl.Document Property

wpf-devexpress-dot-xpf-dot-richedit-dot-richeditcontrol-7baa1c76.md

latest5.0 KB
Original Source

RichEditControl.Document Property

Provides access to a Document interface representing the control’s document.

Namespace : DevExpress.Xpf.RichEdit

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

NuGet Package : DevExpress.Wpf.RichEdit

Declaration

csharp
[Browsable(false)]
public Document Document { get; }
vb
<Browsable(False)>
Public ReadOnly Property Document As Document

Property Value

TypeDescription
Document

A Document interface representing a document loaded in the control.

|

Remarks

The Document property is the main access point to XtraRichEdit API.

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

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-use-docvariable-fields/CS/MainWindow.xaml.cs#L35

csharp
myMergeOptions.MergeMode = MergeMode.NewSection;
richEditControl1.Document.MailMerge(myMergeOptions, richEditControl2.Document);
tabControl.SelectedIndex = 1;

syntax-highlighting-for-c-and-vb-code-using-devexpress-codeparser-and-syntax-highlight-tokens/CS/SyntaxHighlightSimple/MainWindow.xaml.cs#L74

csharp
Document document = syntaxEditor.Document;
CharacterProperties cp = document.BeginUpdateCharacters(0, 1);

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

csharp
myMergeOptions.MergeMode = MergeMode.NewSection;
richEditControl1.Document.MailMerge(myMergeOptions, richEditControl2.Document);
tabControl.SelectedIndex = 1;

how-to-implement-t-sql-language-syntax-highlighting-by-creating-syntax-highlight-tokens/CS/DXRichEditSyntaxExample/MainWindow.xaml.cs#L20

csharp
InitializeComponent();
richEditControl1.ReplaceService<ISyntaxHighlightService>(new CustomSyntaxHighlightService(richEditControl1.Document));
richEditControl1.LoadDocument("CarsXtraScheduling.sql");

wpf-richedit-use-document-iterator-and-visitor/CS/DocumentIteratorExample/MainWindow.xaml.cs#L32

csharp
MyVisitor visitor = new MyVisitor();
DocumentIterator iterator = new DocumentIterator(richEditControl1.Document, true);
while (iterator.MoveNext())

syntax-highlighting-for-c-and-vb-code-using-devexpress-codeparser-and-syntax-highlight-tokens/VB/SyntaxHighlightSimple/MainWindow.xaml.vb#L69

vb
If tokens Is Nothing OrElse tokens.Count = 0 Then Return
Dim document As Document = syntaxEditor.Document
Dim cp As CharacterProperties = document.BeginUpdateCharacters(0, 1)

wpf-richedit-use-docvariable-fields/VB/MainWindow.xaml.vb#L114

vb
Private Sub ShowFieldCodes(ByVal showCodes As Boolean)
    Dim doc As Document = richEdit.Document
    doc.BeginUpdate()

See Also

RichEditControl Class

RichEditControl Members

DevExpress.Xpf.RichEdit Namespace