Alsing.Windows.Forms.SyntaxBox.EditViewControl.GotoLine C# (CSharp) Method

GotoLine() public method

Places the caret on a specified line and scrolls the caret into view.
public GotoLine ( int RowIndex ) : void
RowIndex int the zero based index of the line to jump to
return void
        public void GotoLine(int RowIndex)
        {
            if (RowIndex >= Document.Count)
                RowIndex = Document.Count - 1;

            if (RowIndex < 0)
                RowIndex = 0;

            Caret.Position.Y = RowIndex;
            Caret.Position.X = 0;
            Caret.CurrentRow.EnsureVisible();
            ClearSelection();
            ScrollIntoView();
            Redraw();
        }