DrawEventArgs.Brick Property
Gets a visual brick that represents this control’s contents on a report page.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v20.2.dll
NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.Reporting.Core
Declaration
Property Value
Type | Description |
---|---|
VisualBrick | A VisualBrick object which represents the control’s contents. |
Remarks
Use the Brick property to access the VisualBrick containing information about this control on a report page. Note that if this control is rendered several times in the document (e.g. if the control is bound to data), then this property returns a brick which corresponds to a particular rendering for this control.
Example
The following example demonstrates how to use the XRControl.Draw event. The handler method below draws a red ellipse in the rectangle occupied by the XRControl object.
using System.Drawing;
using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
// ...
private void xrControl1_Draw(object sender, DrawEventArgs e) {
// Get a rectangle occupied by a control.
Rectangle rect = Rectangle.Truncate(e.Bounds);
if(e.UniGraphics is GdiGraphics) {
// Obtain a Graphics object.
GdiGraphics graph = (GdiGraphics)e.UniGraphics;
// Fill the interior of the ellipse defined
// by the rectangle with a Red color.
graph.Graphics.FillEllipse(Brushes.Red, rect);
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Brick 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.