Get caret position

SyntaxEditor for WPF Forum

Posted 3 years ago by Miguel A.
Version: 18.1.0672
Avatar

Hi,

I would like to show a popup below caret position. For this I would need to get the actual position within the application. How can I do that?

Comments (2)

Answer - Posted 3 years ago by Miguel A.
Avatar

I've already figured it out. In case someone else looks for this, here is my solution:

 

var rect = editor.ActiveView.TransformFromTextArea(editor.ActiveView.CurrentViewLine.GetCharacterBounds(editor.ActiveView.Selection.EndOffset).Rect);
Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

You can call also call the editor.ActiveView.GetCharacterBounds() method to get that.


Actipro Software Support

The latest build of this product (v21.1.2) was released 20 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.