Back to Devexpress

BeforePagePaintEventArgs.Painter Property

officefileapi-devexpress-dot-xtrarichedit-dot-beforepagepainteventargs.md

latest3.4 KB
Original Source

BeforePagePaintEventArgs.Painter Property

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

Declaration

csharp
public PagePainter Painter { get; set; }
vb
Public Property Painter As PagePainter

Property Value

TypeDescription
PagePainter

A PagePainter class or its descendant.

|

Remarks

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

csharp
{
    e.Painter = new MyLayoutPainter();
}

winforms-richedit-enable-line-numbering-and-count-document-rows/CS/LineNumberingExample/Form1.cs#L58

csharp
customPagePainter.LineNumberPadding = 60;
    e.Painter = customPagePainter;
}

winforms-richedit-layout-api/VB/Form1.vb#L103

vb
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

vb
customPagePainter.LineNumberPadding = 60
    e.Painter = customPagePainter
End Sub

See Also

BeforePagePaintEventArgs Class

BeforePagePaintEventArgs Members

DevExpress.XtraRichEdit Namespace