Minor bug in ViewMouseDown event?

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Karl Grambow
Avatar
Hi,

Not sure if this is a bug or by design.

If you click the end of the line in the ViewMouseDown event the e.HitTestResult.Token value is nothing. I'm using this event to trap for double-clicks and subsequently select the token to the left (or right) of the point that was clicked.

Thanks,

Karl

Comments (2)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Karl,

That is by design since the Token will only show up if there is an actual token under the text.

You can call EditorView.LocationToOffset and pass it a LocationToPositionAlgorithm.BestFit to get the offset that is closest. Then use that to find the appropriate token in the Document.Tokens collection.


Actipro Software Support

Posted 18 years ago by Karl Grambow
Avatar
Nice, I'll give that a try. I would have thought there would have been a LineTerminator token at least but never mind, the BestFit method seems exactly what I need.

Thanks,

Karl
The latest build of this product (v24.1.1) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.