A newer version of this page is available. Switch to the current version.

CharacterCombBrick Class

A visual brick containing text whose characters are displayed in individual cells.

Namespace: DevExpress.XtraPrinting

Assembly: DevExpress.Printing.v18.2.Core.dll

Declaration

[BrickExporter(typeof(CharacterCombBrickExporter))]
public class CharacterCombBrick :
    TextBrickBase
<BrickExporter(GetType(CharacterCombBrickExporter))>
Public Class CharacterCombBrick
    Inherits TextBrickBase

Remarks

The CharacterCombBrick class allows you to display characters in separate cells in a document.

character-comb-brick-example

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.

SizeMode Description
AutoSize The cell size depends on the current font size .
AutoWidth Only the cell width depends on the current font size (the CharacterCombBrick.CellWidth property is ignored), and the CharacterCombBrick.CellHeight value is specified manually.
AutoHeight Only the cell height depends on the current font size (the CharacterCombBrick.CellHeight property is ignored), and the CharacterCombBrick.CellWidth value is specified manually.
Custom The cell size is determined by the CharacterCombBrick.CellHeight and CharacterCombBrick.CellWidth property values and does not depend on the assigned font size.

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();
    }
}

Implements

Inheritance

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