Skip to main content

PrintControl.InvalidateBrick(Brick) Method

Redraws the specified brick in a document to apply any changes made to this brick.

Namespace: DevExpress.XtraPrinting.Control

Assembly: DevExpress.XtraPrinting.v23.2.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.Printing

Declaration

public void InvalidateBrick(
    Brick brick
)

Parameters

Name Type Description
brick Brick

A Brick object that needs to be redrawn.

Example

This example illustrates how to change the background color of a brick after clicking it in Print Preview by handling the PrintControl.BrickClick event of PrintControl.

For the changes to take effect, call the PrintControl.InvalidateBrick method to update the document area occupied by the brick.

using DevExpress.XtraPrinting.Control;
// ...

private void printControl1_BrickClick(object sender, BrickEventArgs e) {
    if (e.Brick as VisualBrick != null) {
        // Change the background color.
        (e.Brick as VisualBrick).BackColor = Color.Red;

        // Redraw the brick.
        this.printControl1.InvalidateBrick(e.Brick);
    }
}
See Also