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

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_GetCharacterIndexFromPoint_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.GetCharacterIndexFromPoint*">GetCharacterIndexFromPoint Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_GetCharacterIndexFromPoint_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.GetCharacterIndexFromPoint*"></a>
<h4 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_GetCharacterIndexFromPoint_System_Windows_Point_System_Boolean_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.GetCharacterIndexFromPoint(System.Windows.Point,System.Boolean)">GetCharacterIndexFromPoint(Point, bool)</h4>
<div class="markdown level1 summary"><p>Returns the zero-based insertion index for the specified point.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int GetCharacterIndexFromPoint(Point point, bool snapToText)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetCharacterIndexFromPoint(point As Point, snapToText As Boolean) As Integer</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><span class="xref">Point</span></td>
      <td><span class="parametername">point</span></td>
      <td><p>A point in <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.html">GcTextBox</a> coordinate-space for which to return an insertion index.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">snapToText</span></td>
      <td><p><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> to return the nearest insertion index if there is no character at the specified point;
<a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a> to return –1 if there is no character at the specified point.</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.int32">int</a></td>
      <td><p>The insertion index for the specified point, or –1 if no valid insertion index can be found.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
