# C1.Win.C1Editor.C1TextRange.Move

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_C1Editor_C1TextRange_Move_" data-uid="C1.Win.C1Editor.C1TextRange.Move*">Move Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_C1Editor_C1TextRange_Move_" data-uid="C1.Win.C1Editor.C1TextRange.Move*"></a>
<h4 id="C1_Win_C1Editor_C1TextRange_Move_System_Int32_System_Int32_" data-uid="C1.Win.C1Editor.C1TextRange.Move(System.Int32,System.Int32)">Move(int, int)</h4>
<div class="markdown level1 summary"><p>Moves the current range by the specified offset and length.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Move(int offset, int length)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Move(offset As Integer, length 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="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">offset</span></td>
      <td><p>Specifies the number of characters to offset the current text range in relation to the current start of the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">length</span></td>
      <td><p>Specifies the new length of the range.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_C1Editor_C1TextRange_Move_System_Int32_System_Int32__examples">Examples</h5>
<p>The example marks a character before the selection using yellow color.
<pre><code class="lang-csharp">private void c1Editor1_SelectionChanged(object sender, EventArgs e)
{
if (_colored != null)
{
_colored.RemoveStyle(&quot;color&quot;, &quot;yellow&quot;);
_colored = null;
}
C1TextRange sel = c1Editor1.Selection.Clone();
sel.Move(-1, 1);
sel.ApplyStyle(&quot;color&quot;, &quot;yellow&quot;, C1StyleType.Character);
_colored = sel;
}
private C1TextRange _colored = null;</code></pre>

</div>
