Change Caret Position Based On Cursor

SyntaxEditor for Windows Forms Forum

Posted 13 years ago by Jason Tobiasz
Avatar
How do I change the Caret position based on the cursor position?

[Modified at 06/09/2006 02:03 PM]

Comments (4)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
This will do it:
editor.Caret.Offset = editor.SelectedView.OffsetFromLocation(editor.PointToClient(Control.MousePosition), LocationToOffsetAlgorithm.BestFit);


Actipro Software Support

Posted 13 years ago by Jason Tobiasz
Avatar
How do I set the line and character based on the cursor position?

[Modified at 06/09/2006 02:22 PM]
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I believe there is a PositionFromLocation method as well.


Actipro Software Support

Posted 13 years ago by Jason Tobiasz
Avatar
Thanks.
The latest build of this product (v2018.1 build 0342) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.