DesignerGlyph.GetBounds Method (ActivityDesigner, Boolean)


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

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.

Exception Condition

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;

.NET Framework
Available since 3.0
Return to top