WPF SyntaxEditor how to place the caret at specified position?

SyntaxEditor for WPF Forum

Posted 1 year ago by Murali Mahendra Kumar Banala
Version: 19.1.0681


I have just upgraded the code from version v16.1.0631 to the v19.1.0681 and found that I'm unable to set the caret position of the syntaxEditor to specified location. Here was my earlier code:

IEditorView view = this.syntaxEditor.ActiveView;
view.SyntaxEditor.Caret.Position = new TextPosition(lineNumber, 0);

Now I see that Caret property is not available, how to set the caret position to the desired line number and location?

Thanks in advance

Comments (2)

Posted 1 year ago by Murali Mahendra Kumar Banala

Okay found that it can achieved through


syntaxEditor.ActiveView.Selection.CaretPosition = new TextPosition(lineNumber - 1, 0);

Hope this is correct way of implementation.

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA


Yes that is correct.  We made some breaking changes in 2019.1, but documented all of them.  Please see the "SyntaxEditor / Converting from Previous Versions / Converting to 2019.1" topic in the documentation that comes with the product.  That walks through everything that was changed.

Actipro Software Support

The latest build of this product (v2019.1 build 0685) was released 5 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.