This documentation is archived and is not being maintained.

DesignerGlyph.GetBounds Method

Returns the bounds for the glyph on the specified ActivityDesigner.

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

public virtual Rectangle GetBounds(
	ActivityDesigner designer,
	bool activated


Type: System.Workflow.ComponentModel.Design.ActivityDesigner

The ActivityDesigner with which the glyph is associated.

Type: System.Boolean

true to indicate whether the glyph appears on the activity designer surface; otherwise, false.

Return Value

Type: System.Drawing.Rectangle
A Rectangle that represents the bounds for the glyph.


designer contains a null reference (Nothing in Visual Basic).

Unless overridden in a derived class, GetBounds returns the bounds of the activity designer with which the glyph is associated.

The following code example demonstrates how you can override the GetBounds method. The code sets the size and location of the custom glyph object.

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;

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0