Skip to main content

DrawEventArgs.Brick Property

Gets a visual brick that represents this control’s contents on a report page.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v23.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

public VisualBrick Brick { get; }

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);
    }
}
See Also