ViewPortRectangle Property

WorkflowView.ViewPortRectangle Property

Gets the current ViewPortRectangle for the WorkflowView.

Namespace: System.Workflow.ComponentModel.Design
Assembly: System.Workflow.ComponentModel (in system.workflow.componentmodel.dll)

public Rectangle ViewPortRectangle { get; }
/** @property */
public Rectangle get_ViewPortRectangle ()

public function get ViewPortRectangle () : Rectangle

Not applicable.

Property Value

A Rectangle that describes the area on the screen that is visible.

The ViewPortRectangle contains the visible area of the workflow.

The following example shows a method of handling the Paint event of the WorkflowView object to draw an image directly on the WorkflowView. The ViewPortRectangle property returns the viewable area on the design surface to correctly constrain the image being drawn.

void workflowView_Paint(object sender, PaintEventArgs e)
    using (Graphics g = this.workflowView.CreateGraphics())
        Bitmap draftImage = Properties.Resources.draft;
        g.DrawImage(draftImage, this.workflowView.ViewPortRectangle);

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

© 2016 Microsoft