IRawElementProviderFragment.BoundingRectangle Property


Gets the bounding rectangle of this element.

 property System::Windows::Rect BoundingRectangle { System::Windows::Rect get(); };
public System.Windows.Rect BoundingRectangle { get; }
member this.BoundingRectangle : System.Windows.Rect
Public ReadOnly Property BoundingRectangle As Rect

Property Value

The bounding rectangle, in screen coordinates.


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);
''' <summary>
''' Gets the bounding rectangle.
''' </summary>

Public ReadOnly Property BoundingRectangle() As System.Windows.Rect _
    Implements IRawElementProviderFragment.BoundingRectangle
        Return New System.Windows.Rect(myBounds.X, myBounds.Y, myBounds.Width, myBounds.Height)
    End Get
End Property


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.

Applies to

See also