TextBrick Class

A visual brick that contains text.

Namespace: DevExpress.XtraPrinting

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

Declaration

[BrickExporter(typeof(TextBrickExporter))]
public class TextBrick :
    TextBrickBase,
    ITextBrick,
    IVisualBrick,
    IBaseBrick,
    IBrick,
    ITableCell
<BrickExporter(GetType(TextBrickExporter))>
Public Class TextBrick
    Inherits TextBrickBase
    Implements ITextBrick,
               IVisualBrick,
               IBaseBrick,
               IBrick,
               ITableCell

Related API Members

The following members accept/return TextBrick objects:

Remarks

TextBrick is used to type plain text in a document and provides options that define the text color, alignment, font and format settings.

TextBrick

To print rotated text in your document, use the LabelBrick class.

To insert rich text into your document, use the RichTextBrick class.

Examples

This example demonstrates how to create a TextBrick using the BrickGraphics.DrawString method.

MeasureString1

using DevExpress.XtraPrinting;
// ...

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

    // Measure the string.
    SizeF sz = brickGraph.MeasureString(s);

    // Start the report generation.
    printingSystem1.Begin();

    // Create a rectangle of the calculated size.
    RectangleF rect = new RectangleF(new PointF(0, 0), sz);
    // Specify a page area.
    brickGraph.Modifier = BrickModifier.Detail;
    // Create a text brick.
    visBrick = brickGraph.DrawString(s, Color.Black, rect, BorderSide.All);

    // Finish the report generation.
    printingSystem1.End();

    // Preview the report.
    printingSystem1.PreviewFormEx.Show();

Inheritance

Object
DevExpress.Printing.Utils.DocumentStoring.StorableObjectBase
See Also