IRawElementProviderFragment.BoundingRectangle Property


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

Gets the bounding rectangle of this element.

Namespace:   System.Windows.Automation.Provider
Assembly:  UIAutomationProvider (in UIAutomationProvider.dll)

Rect BoundingRectangle { get; }

Property Value

Type: System.Windows.Rect

The bounding rectangle, in screen coordinates.

No clipping is required if the element is partly obscured or partly off-screen. The IsOffscreen property should be set to indicate whether the rectangle is actually visible.

Not all points within the bounding rectangle are necessarily clickable.

In the following example code, the internal state of the bounding rectangle is kept in a System.Drawing.Rectangle, which is converted to a System.Windows.Rect before being returned.

/// <summary>
/// Gets the bounding rectangle.
/// </summary>
public System.Windows.Rect BoundingRectangle
        return new System.Windows.Rect(myBounds.X, myBounds.Y, myBounds.Width, myBounds.Height);

.NET Framework
Available since 3.0
Return to top