Posted 13 years ago by Kasper
Avatar
Okay, this is probably simple, but since I have already used more than 15 minutes to figure out what's wrong, I better ask :P. I get a line and a character value, and now I wish to set the cursor accordingly. Since I can't figure out a way to set the cursor to a character position within the line, I searched the forum and found out that I'm to use the PositionToOffset method. I know the line and character values I get are correct, since I can see in the editor that they fit - however, when I put them through PositionToOffset and set the StartOffset like this: Editor.SelectedView.Selection.StartOffset = offset;, the character is not in the right place. The returned offset is too high for some reason - why? :)

Comments (1)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It might be that the line/character are zero-based and perhaps you are passing one-based values?


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 10 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.