Share via


IRawElementProviderFragment.BoundingRectangle 屬性

定義

取得此項目的週框。

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

屬性值

螢幕座標中的週框。

範例

在下列範例程式碼中,周框的內部狀態會保留在 中 System.Drawing.Rectangle ,這會在傳回之前轉換成 System.Windows.Rect

/// <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

備註

如果元素部分遮蔽或部分螢幕外,則不需要裁剪。 IsOffscreen屬性應該設定為指出矩形是否實際可見。

並非所有周框內的點都必須可點選。

適用於

另請參閱