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.v20.1.dll

Declaration

public void InvalidateBrick(
    Brick brick
)
Public Sub InvalidateBrick(
    brick As Brick
)

Parameters

Name Type Description
brick Brick

A Brick object that needs to be redrawn.

Examples

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.

TIP

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E141.

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