# C1.WPF.RichTextBox.Documents.C1TextPointer.GetOffsetToPosition

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_RichTextBox_Documents_C1TextPointer_GetOffsetToPosition_" data-uid="C1.WPF.RichTextBox.Documents.C1TextPointer.GetOffsetToPosition*">GetOffsetToPosition Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_RichTextBox_Documents_C1TextPointer_GetOffsetToPosition_" data-uid="C1.WPF.RichTextBox.Documents.C1TextPointer.GetOffsetToPosition*"></a>
<h4 id="C1_WPF_RichTextBox_Documents_C1TextPointer_GetOffsetToPosition_C1_WPF_RichTextBox_Documents_C1TextPointer_System_Predicate_C1_WPF_RichTextBox_Documents_Tag__" data-uid="C1.WPF.RichTextBox.Documents.C1TextPointer.GetOffsetToPosition(C1.WPF.RichTextBox.Documents.C1TextPointer,System.Predicate{C1.WPF.RichTextBox.Documents.Tag})">GetOffsetToPosition(C1TextPointer, Predicate&lt;Tag&gt;)</h4>
<div class="markdown level1 summary"><p>Returns the count of symbols between this <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextPointer.html">C1TextPointer</a> and a second specified <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextPointer.html">C1TextPointer</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int GetOffsetToPosition(C1TextPointer position, Predicate&lt;Tag&gt; tagFilter)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetOffsetToPosition(position As C1TextPointer, tagFilter As Predicate(Of Tag)) 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><a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextPointer.html">C1TextPointer</a></td>
      <td><span class="parametername">position</span></td>
      <td><p>A <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextPointer.html">C1TextPointer</a> that specifies a position to find the distance (in symbols) to.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.predicate-1">Predicate</a>&lt;<a class="xref" href="C1.WPF.RichTextBox.Documents.Tag.html">Tag</a>&gt;</td>
      <td><span class="parametername">tagFilter</span></td>
      <td><p>A predicate that can be called to check if a <a class="xref" href="C1.WPF.RichTextBox.Documents.Tag.html">Tag</a> should count as offset.
The predicate should return true iff the tag doesn't count. Can be null, which means no filter.</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 relative number of symbols between the current <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextPointer.html">C1TextPointer</a> and position.
A negative value indicates that the current <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextPointer.html">C1TextPointer</a> follows the position specified by position,
0 indicates that the positions are equal,
and a positive value indicates that the current <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextPointer.html">C1TextPointer</a> precedes the position specified by position.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_RichTextBox_Documents_C1TextPointer_GetOffsetToPosition_" data-uid="C1.WPF.RichTextBox.Documents.C1TextPointer.GetOffsetToPosition*"></a>
<h4 id="C1_WPF_RichTextBox_Documents_C1TextPointer_GetOffsetToPosition_C1_WPF_RichTextBox_Documents_C1TextPointer_" data-uid="C1.WPF.RichTextBox.Documents.C1TextPointer.GetOffsetToPosition(C1.WPF.RichTextBox.Documents.C1TextPointer)">GetOffsetToPosition(C1TextPointer)</h4>
<div class="markdown level1 summary"><p>Equivalent to <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextPointer.GetOffsetToPosition.html#C1_WPF_RichTextBox_Documents_C1TextPointer_GetOffsetToPosition_C1_WPF_RichTextBox_Documents_C1TextPointer_System_Predicate_C1_WPF_RichTextBox_Documents_Tag__">GetOffsetToPosition(C1TextPointer, Predicate&lt;Tag&gt;)</a> with null as tagFilter.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int GetOffsetToPosition(C1TextPointer position)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetOffsetToPosition(position As C1TextPointer) 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><a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextPointer.html">C1TextPointer</a></td>
      <td><span class="parametername">position</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.int32">int</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
