# C1.Framework.Element.GetBounds

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Framework_Element_GetBounds_" data-uid="C1.Framework.Element.GetBounds*">GetBounds Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Framework_Element_GetBounds_" data-uid="C1.Framework.Element.GetBounds*"></a>
<h4 id="C1_Framework_Element_GetBounds_C1_Framework_Element_" data-uid="C1.Framework.Element.GetBounds(C1.Framework.Element)">GetBounds(Element)</h4>
<div class="markdown level1 summary"><p>Gets the element's bounds (size and location) within an arbitrary ancestor, in pixels.</p>
<param name="ancestor">Ancestor element (parent, grand-parent, etc).
<returns>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectangle">Rectangle</a> that corresponds to the element's position 
within the given <code class="paramref">ancestor</code>.</returns>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Rectangle GetBounds(Element ancestor)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetBounds(ancestor As Element) As Rectangle</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Framework.Element.html">Element</a></td>
      <td><span class="parametername">ancestor</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectangle">Rectangle</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_Framework_Element_GetBounds_" data-uid="C1.Framework.Element.GetBounds*"></a>
<h4 id="C1_Framework_Element_GetBounds_C1_Framework_Element_System_Boolean_System_Boolean_" data-uid="C1.Framework.Element.GetBounds(C1.Framework.Element,System.Boolean,System.Boolean)">GetBounds(Element, bool, bool)</h4>
<div class="markdown level1 summary"><p>Gets the element's bounds (size and location) within an arbitrary ancestor, in pixels.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Rectangle GetBounds(Element ancestor, bool contentArea, bool clip)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetBounds(ancestor As Element, contentArea As Boolean, clip As Boolean) As Rectangle</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Framework.Element.html">Element</a></td>
      <td><span class="parametername">ancestor</span></td>
      <td><p>Ancestor element (parent, grand-parent, etc).</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">contentArea</span></td>
      <td><p>Whether to return the element's outer bounds or content area.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">clip</span></td>
      <td><p>Whether to clip the rectangle to the ancestor's content area.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectangle">Rectangle</a></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.rectangle">Rectangle</a> that corresponds to the element's position
within the given <code class="paramref">ancestor</code>.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
