ContainerVisual.ContentBounds 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得 ContainerVisual 內容的週框方塊。
public:
property System::Windows::Rect ContentBounds { System::Windows::Rect get(); };
public System.Windows.Rect ContentBounds { get; }
member this.ContentBounds : System.Windows.Rect
Public ReadOnly Property ContentBounds As Rect
屬性值
指定週框方塊的 Rect。
範例
下列範例示範如何擷取 物件的周框 ContainerVisual 。
// Return the bounding rectangle for the ContainerVisual.
Rect rectBounds = containerVisual.ContentBounds;
// Expand the rectangle to include the bounding rectangle
// of the all of the ContainerVisual's descendants.
rectBounds.Union(containerVisual.DescendantBounds);
' Return the bounding rectangle for the ContainerVisual.
Dim rectBounds As Rect = containerVisual.ContentBounds
' Expand the rectangle to include the bounding rectangle
' of the all of the ContainerVisual's descendants.
rectBounds.Union(containerVisual.DescendantBounds)
備註
DescendantBounds使用 屬性可傳回物件所有子系之所有內容周框方塊的 ContainerVisual 聯集,但不會傳回物件本身。