Skip to main content

CreateAreaEventArgs Class

Provides data for all area creation events.

Namespace: DevExpress.XtraPrinting

Assembly: DevExpress.Printing.v24.1.Core.dll

NuGet Package: DevExpress.Printing.Core

Declaration

public class CreateAreaEventArgs :
    EventArgs

Remarks

An area creation event occurs on document creation. The CreateAreaEventArgs.Graph property provides a BrickGraphics class instance. Property values of the BrickGraphics object returned by this property define the default values for properties of different brick types - determining the appearance of a specific brick. These properties include: TextBrick.Font, VisualBrick.BorderColor, BrickGraphics.BorderWidth, VisualBrick.BackColor, etc. If a user sets these properties to a specific value, the default values are overridden.

Example

The following example demonstrates how to write a LinkBase.CreateMarginalHeaderArea event handler. The handler will not work unless you write a LinkBase.CreateDetailArea event handler.

Tutorial Areas

using System.Drawing;
using DevExpress.XtraPrinting;
// ...

private void link1_CreateMarginalHeaderArea(object sender, CreateAreaEventArgs e) {
    string format = "Page {0} of {1}";
    e.Graph.Font = e.Graph.DefaultFont;
    e.Graph.BackColor = Color.Transparent;

    RectangleF r = new RectangleF(0, 0, 0, e.Graph.Font.Height);

    PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, format, 
        Color.Black, r, BorderSide.None);
    brick.Alignment = BrickAlignment.Far;
    brick.AutoWidth = true;

    brick = e.Graph.DrawPageInfo(PageInfo.DateTime, "", Color.Black, r, BorderSide.None);
    brick.Alignment = BrickAlignment.Near;
    brick.AutoWidth = true;
}

Inheritance

Object
EventArgs
CreateAreaEventArgs
See Also