Skip to main content

BrickStringFormat Class

Encapsulates text layout information (such as alignment, orientation and tab stops) and display manipulations (such as ellipsis insertion and national digit substitution).

Namespace: DevExpress.XtraPrinting

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


public class BrickStringFormat :


The BrickStringFormat class defines formatting for bricks containing text information. Format settings include text, line alignment, and formatting flags.


The following code demonstrates use of the BrickStringFormat. It creates a new BrickStringFormat object, sets the text alignment to Center, and text direction to DirectionVertical.

StingForamt example

using DevExpress.XtraPrinting;
// ...

    VisualBrick visBrick;
    BrickGraphics brickGraph = printingSystem1.Graph;
    string s = "Developer Express Inc.";

    // Specify the string format.
    StringFormat sFormat = new StringFormat(StringFormatFlags.DirectionVertical);
    sFormat.Alignment = StringAlignment.Center;
    sFormat.LineAlignment = StringAlignment.Center;

    // Create the BrickStringFormat object.
    BrickStringFormat brickSFormat = new BrickStringFormat(sFormat);

    // Measure the string according to the specified format
    SizeF sz = brickGraph.MeasureString(s, 30, sFormat);

    // Start the report generation.

    // Set the brick string format
    brickGraph.StringFormat = brickSFormat;

    // Create a rectangle.
    RectangleF rect = new RectangleF(new PointF(0, 0), new SizeF(30, 150));
    // Specify a page area.
    brickGraph.Modifier = BrickModifier.Detail;
    // Add a brick to the report.
    visBrick = brickGraph.DrawString(s, Color.MidnightBlue, rect, BorderSide.All);

    // Finish the report generation.

    // Preview the report.

The following code snippets (auto-collected from DevExpress Examples) contain references to the BrickStringFormat class.


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.


See Also