CharacterCombBrick Class
In This Article
A visual brick containing text whose characters are displayed in individual cells.
Namespace: DevExpress.XtraPrinting
Assembly: DevExpress.Printing.v24.2.Core.dll
NuGet Package: DevExpress.Printing.Core
#Declaration
[BrickExporter(typeof(CharacterCombBrickExporter))]
public class CharacterCombBrick :
TextBrickBase
#Remarks
The CharacterCombBrick class allows you to display characters in separate cells in a document.
Use the CharacterCombBrick.CellVerticalSpacing and CharacterCombBrick.CellHorizontalSpacing properties to specify the spacing between adjacent cells.
The CharacterCombBrick.CellSizeMode property defines how and whether the cell size should depend on the current font size.
Size |
Description |
---|---|
Auto |
The cell size depends on the current font size . |
Auto |
Only the cell width depends on the current font size (the Character |
Auto |
Only the cell height depends on the current font size (the Character |
Custom | The cell size is determined by the Character |
The following example demonstrates how to draw the CharacterCombBrick in the document.
using System;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.XtraPrinting;
public partial class Form1 : Form {
PrintingSystem printingSystem = new PrintingSystem();
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
documentViewer1.PrintingSystem = printingSystem;
}
private void btnDrawCharacterComb_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
// Prepare for creating a document.
printingSystem.Begin();
BrickGraphics gr = printingSystem.Graph;
gr.Modifier = BrickModifier.Detail;
// Create a new brick instance.
CharacterCombBrick brick = new CharacterCombBrick();
// Set the brick's static text and specify its size.
brick.Text = "First Name";
brick.Rect = new RectangleF(0, 0, 200, 150);
// Specify the cell width and height.
brick.CellSizeMode = SizeMode.Custom;
brick.CellWidth = 100;
brick.CellHeight = 100;
// Specify the spacing between cells.
brick.CellHorizontalSpacing = 10;
brick.CellVerticalSpacing = 10;
// Draw this brick.
gr.DrawBrick(brick);
// Finish creating the document.
printingSystem.End();
}
}
#Inheritance
Object
DevExpress.Printing.Utils.DocumentStoring.StorableObjectBase
BrickBase
Brick
VisualBrick
TextBrickBase
CharacterCombBrick
See Also