IRawElementProviderFragment.BoundingRectangle Property

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
{
    get 
    {
        return new System.Windows.Rect(myBounds.X, myBounds.Y, myBounds.Width, myBounds.Height);
    }
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft