ActivityDesigner.Bounds Property

Definition

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

C#
public System.Drawing.Rectangle Bounds { get; }

Property Value

A Rectangle that encloses the designer.

Examples

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.

C#
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;
}

Remarks

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

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also