Editar

Partilhar via


IRawElementProviderFragment.BoundingRectangle Property

Definition

Gets the bounding rectangle of this element.

public:
 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.

Examples

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

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

Remarks

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