PrintControl.BrickClick Event

Occurs when the region of a brick within the PrintControl is clicked.

Namespace: DevExpress.XtraPrinting.Control

Assembly: DevExpress.XtraPrinting.v20.2.dll

Declaration

public event BrickEventHandler BrickClick
Public Event BrickClick As BrickEventHandler

Event Data

The BrickClick event's data class is BrickEventArgs. The following properties provide information specific to this event:

Property Description
Args Returns an object storing the event arguments.
Brick Gets a brick for which an event has been raised. Inherited from BrickEventArgsBase.
BrickScreenBounds Returns the rectangle displayed when clicking a brick.
Page Returns the document page containing the brick for which the corresponding event was fired.
X Returns the horizontal mouse position within a brick.
Y Returns the vertical mouse position within a brick.

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