Get caret position

SyntaxEditor for WPF Forum

Posted 1 year 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 1 year 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 1 year 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 (v2019.1 build 0684) was released 13 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.