ActivityDesigner.Bounds Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets a Rectangle which contains the value for the enclosing rectangle of the designer in logical coordinates.

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

public Rectangle Bounds { get; }

Property Value

Type: System.Drawing.Rectangle

A Rectangle that encloses the designer.

You can use the rectangle returned by the bounds method to determine the area enclosed by the designer plus the selection area.

The following code example demonstrates how you can use the Bounds property to determine the new bounding rectangle for a glyph displayed on an ActivityDesigner.

This code example is part of the Workflow Monitor SDK Sample from the DesignerGlyphProvider.cs file. For more information, see Workflow Monitor.

public override Rectangle GetBounds(ActivityDesigner designer, bool activated)
{
    Rectangle imageBounds = Rectangle.Empty;
    Image image = Resources.Executing;
    if (image != null)
    {
        Size glyphSize = WorkflowTheme.CurrentTheme.AmbientTheme.GlyphSize;
        imageBounds.Location = new Point(designer.Bounds.Right - glyphSize.Width / 2, designer.Bounds.Top - glyphSize.Height / 2);
        imageBounds.Size = glyphSize;
    }
    return imageBounds;
}

.NET Framework
Available since 3.0
Return to top
Show: