# C1.WPF.RichTextBox.Documents.C1TextPointer.GetPositionAtOffset

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_RichTextBox_Documents_C1TextPointer_GetPositionAtOffset_" data-uid="C1.WPF.RichTextBox.Documents.C1TextPointer.GetPositionAtOffset*">GetPositionAtOffset Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_RichTextBox_Documents_C1TextPointer_GetPositionAtOffset_" data-uid="C1.WPF.RichTextBox.Documents.C1TextPointer.GetPositionAtOffset*"></a>
<h4 id="C1_WPF_RichTextBox_Documents_C1TextPointer_GetPositionAtOffset_System_Int32_System_Predicate_C1_WPF_RichTextBox_Documents_Tag__" data-uid="C1.WPF.RichTextBox.Documents.C1TextPointer.GetPositionAtOffset(System.Int32,System.Predicate{C1.WPF.RichTextBox.Documents.Tag})">GetPositionAtOffset(int, Predicate&lt;Tag&gt;)</h4>
<div class="markdown level1 summary"><p>Returns the position at an offset of the current position, optionally not counting some positions.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public C1TextPointer GetPositionAtOffset(int offset, Predicate&lt;Tag&gt; tagFilter)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetPositionAtOffset(offset As Integer, tagFilter As Predicate(Of Tag)) As C1TextPointer</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">offset</span></td>
      <td><p>The offset.</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="C1.WPF.RichTextBox.Documents.C1TextPointer.html">C1TextPointer</a></td>
      <td><p>A new position at the offset indicated, or null if the offset goes off the document.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_RichTextBox_Documents_C1TextPointer_GetPositionAtOffset_System_Int32_System_Predicate_C1_WPF_RichTextBox_Documents_Tag___remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>
This method can be used to linearly traverse a <a class="xref" href="C1.WPF.RichTextBox.Documents.C1Document.html">C1Document</a> tree.
</p>
<p>
Start and end tags in each <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextElement.html">C1TextElement</a> count as items for the traverse, for instance
if the position is in an element with children, a position at offset 1 will be the <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextElement.ContentStart.html#C1_WPF_RichTextBox_Documents_C1TextElement_ContentStart">ContentStart</a>
of the <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextElement.html">C1TextElement</a> where this C1TextPointer is positioned.
</p>
<p>
If this C1TextPointer is positioned in a <a class="xref" href="C1.WPF.RichTextBox.Documents.C1Run.html">C1Run</a> then it traverses the text of the C1Run.
</p>
</div>


<a id="C1_WPF_RichTextBox_Documents_C1TextPointer_GetPositionAtOffset_" data-uid="C1.WPF.RichTextBox.Documents.C1TextPointer.GetPositionAtOffset*"></a>
<h4 id="C1_WPF_RichTextBox_Documents_C1TextPointer_GetPositionAtOffset_System_Int32_" data-uid="C1.WPF.RichTextBox.Documents.C1TextPointer.GetPositionAtOffset(System.Int32)">GetPositionAtOffset(int)</h4>
<div class="markdown level1 summary"><p>Equivalent to <a class="xref" href="C1.WPF.RichTextBox.Documents.C1TextPointer.GetPositionAtOffset.html#C1_WPF_RichTextBox_Documents_C1TextPointer_GetPositionAtOffset_System_Int32_System_Predicate_C1_WPF_RichTextBox_Documents_Tag__">GetPositionAtOffset(int, 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 C1TextPointer GetPositionAtOffset(int offset)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetPositionAtOffset(offset As Integer) As C1TextPointer</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">offset</span></td>
      <td><p>The offset.</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="C1.WPF.RichTextBox.Documents.C1TextPointer.html">C1TextPointer</a></td>
      <td><p>A new position at the offset indicated, or null if the offset goes off the document.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
