MindFusion WinForms Programmer's Guide
Canvas.RenderContents Event
See Also
 





Raised to enable you to perform custom rendering within the canvas.

Namespace: MindFusion.Reporting
Assembly: MindFusion.Reporting

 Syntax

C#  Copy Code

public event EventHandler<DrawCanvasEventArgs> RenderContents

Visual Basic  Copy Code

Public Event RenderContents As EventHandler(Of DrawCanvasEventArgs)

 Event Data

RenderContents event handlers receive an argument of type DrawCanvasEventArgs.

 Example

The following example illustrates how to render a rectangle using a Canvas object. The example assumes that canvas1 is a variable that references a valid Canvas instance.

C#  Copy Code

canvas1.RenderContents += new DrawCanvasEventHandler(this.OnDrawCanvas);

// ...

private void OnDrawCanvas(object sender, DrawCanvasEventArgs e)
{
    // Render a black rectangle
    e.Graphics.DrawRectangle(Pens.Black, e.Bounds);
}

Visual Basic  Copy Code

AddHandler(canvas1.RenderCanvas, AddressOf Me.OnDrawCanvas)

' ...

Private Sub OnDrawCanvas(ByRef sender As Object, ByRef e As DrawCanvasEventArgs)

    ' Render a black rectangle
    e.Graphics.DrawRectangle(Pens.Black, e.Bounds)

End Sub

 See Also

Canvas Members
Canvas Class
MindFusion.Reporting Namespace