Caret's coordinate

SyntaxEditor for WPF Forum

Posted 2 years ago by Daisuke Nakada
Version: 17.2.0664
Avatar

Hi,

Please tell me how to get the caret's coordinate (x and y).

 

Thank you.

Comments (2)

Answer - Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I believe this is what you are looking for (X/Y relative to the SyntaxEditor control):

var bounds = editor.ActiveView.TransformFromTextArea(editor.ActiveView.GetCharacterBounds(editor.Caret.Offset).Rect);


Actipro Software Support

Posted 2 years ago by Daisuke Nakada
Avatar

Thank you very much!

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

Add Comment

Please log in to a validated account to post comments.