Change Caret Position Based On Cursor

SyntaxEditor for Windows Forms Forum

Posted 18 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 18 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 18 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 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I believe there is a PositionFromLocation method as well.


Actipro Software Support

Posted 18 years ago by Jason Tobiasz
Avatar
Thanks.
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.