officefileapi-devexpress-dot-xtrarichedit-dot-beforepagepainteventargs.md
Gets or sets the painter object which implements methods for drawing layout elements.
Namespace : DevExpress.XtraRichEdit
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
public PagePainter Painter { get; set; }
Public Property Painter As PagePainter
| Type | Description |
|---|---|
| PagePainter |
A PagePainter class or its descendant.
|
To implement custom drawing for layout elements, subclass the PagePainter type to override methods required to draw particular layout elements and use the Painter property to specify an instance of your class instead of the default painter.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Painter 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.
winforms-richedit-layout-api/CS/Form1.cs#L126
{
e.Painter = new MyLayoutPainter();
}
winforms-richedit-enable-line-numbering-and-count-document-rows/CS/LineNumberingExample/Form1.cs#L58
customPagePainter.LineNumberPadding = 60;
e.Painter = customPagePainter;
}
winforms-richedit-layout-api/VB/Form1.vb#L103
Private Sub richEditControl1_BeforePagePaint(ByVal sender As Object, ByVal e As BeforePagePaintEventArgs)
e.Painter = New MyLayoutPainter()
End Sub
winforms-richedit-enable-line-numbering-and-count-document-rows/VB/LineNumberingExample/Form1.vb#L53
customPagePainter.LineNumberPadding = 60
e.Painter = customPagePainter
End Sub
See Also
BeforePagePaintEventArgs Class