# GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.GetRectFromCharacterIndex

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_GetRectFromCharacterIndex_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.GetRectFromCharacterIndex*">GetRectFromCharacterIndex Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_GetRectFromCharacterIndex_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.GetRectFromCharacterIndex*"></a>
<h4 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_GetRectFromCharacterIndex_System_Int32_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.GetRectFromCharacterIndex(System.Int32)">GetRectFromCharacterIndex(int)</h4>
<div class="markdown level1 summary"><p>Returns the rectangle for the leading edge of the character at the specified index.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Rect GetRectFromCharacterIndex(int charIndex)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetRectFromCharacterIndex(charIndex As Integer) As Rect</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="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">charIndex</span></td>
      <td><p>The zero-based character index of the character for which to retrieve the rectangle.</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><span class="xref">Rect</span></td>
      <td><p>A rectangle for the leading edge of the character at the specified character index,
or <span class="xref">Rect.Empty</span> if a bounding rectangle cannot be determined.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></td>
      <td><p><code class="paramref">charIndex</code> is negative or greater than the length of the content.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_GetRectFromCharacterIndex_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.GetRectFromCharacterIndex*"></a>
<h4 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_GetRectFromCharacterIndex_System_Int32_System_Boolean_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.GetRectFromCharacterIndex(System.Int32,System.Boolean)">GetRectFromCharacterIndex(int, bool)</h4>
<div class="markdown level1 summary"><p>Returns the rectangle for the leading or trailing edge of the character at the specified index.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Rect GetRectFromCharacterIndex(int charIndex, bool trailingEdge)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetRectFromCharacterIndex(charIndex As Integer, trailingEdge As Boolean) As Rect</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="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">charIndex</span></td>
      <td><p>The zero-based character index of the character for which to retrieve the bounding rectangle.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">trailingEdge</span></td>
      <td><p><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> to get the trailing edge of the character; <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a> to get the leading edge of the character.</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><span class="xref">Rect</span></td>
      <td><p>A bounding rectangle for the character at the specified character index,
or <span class="xref">System.Windows.Rect.Empty</span> if a bounding rectangle cannot be determined.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></td>
      <td><p><code class="paramref">charIndex</code> is negative or greater than the length of the content.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
