Editor for WinForms | ComponentOne
C1.Win.C1Editor.4.8 Assembly / C1.Win.C1Editor Namespace / C1TextRange Class / Move Method
Specifies the number of characters to offset the current text range in relation to the current start of the range.
Specifies the new length of the range.
Example

In This Topic
    Move Method (C1TextRange)
    In This Topic
    Moves the current range by the specified offset and length.
    Syntax
    'Declaration
     
    Public Sub Move( _
       ByVal offset As System.Integer, _
       ByVal length As System.Integer _
    ) 
    public void Move( 
       System.int offset,
       System.int length
    )

    Parameters

    offset
    Specifies the number of characters to offset the current text range in relation to the current start of the range.
    length
    Specifies the new length of the range.
    Example
    The example marks a character before the selection using yellow color.
    private void c1Editor1_SelectionChanged(object sender, EventArgs e)
    {
          if (_colored != null)
          {
              _colored.RemoveStyle("color", "yellow");
              _colored = null;
          }
          C1TextRange sel = c1Editor1.Selection.Clone();
          sel.Move(-1, 1);
          sel.ApplyStyle("color", "yellow", C1StyleType.Character);
          _colored = sel;
    }
    private C1TextRange _colored = null;
    See Also