TextBrick Class
A visual brick that contains text.
Namespace: DevExpress.XtraPrinting
Assembly: DevExpress.Printing.v24.1.Core.dll
NuGet Package: DevExpress.Printing.Core
#Declaration
[BrickExporter(typeof(TextBrickExporter))]
public class TextBrick :
TextBrickBase,
ITextBrick,
IVisualBrick,
IBaseBrick,
IBrick,
ITableCell
#Related API Members
The following members 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.
To print rotated text in your document, use the LabelBrick class.
To insert rich text into your document, use the RichTextBrick class.
#Example
This example demonstrates how to create a TextBrick
using the BrickGraphics.DrawString method.
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();
See Also