[]
        
(Showing Draft Content)

C1.Win.C1Editor.C1TextRange.Move

Move Method

Move(int, int)

Moves the current range by the specified offset and length.

Declaration
public void Move(int offset, int length)
Parameters
Type Name Description
int offset

Specifies the number of characters to offset the current text range in relation to the current start of the range.

int length

Specifies the new length of the range.

Examples

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;