I can't seem to find out if the mouse cursor is over text in a richtextbox.
I can use GetCharIndexFromPosition but all that does is tell me the closest
character. But if the cursor is outside the range of current text, there's
no way to calculate that. I'm sure there should be something to tell me how
to do this, but I can't seem to find it.
Lance Johnson
This has always been a problem I don't think there is a good solution.

Signature
Stoitcho Goutsev (100) [C# MVP]
>I can't seem to find out if the mouse cursor is over text in a richtextbox.
>I can use GetCharIndexFromPosition but all that does is tell me the closest
[quoted text clipped - 3 lines]
>
> Lance Johnson
Lance Johnson - 08 Apr 2005 16:47 GMT
Well crap. Basically what I did was calculate where the character after the
end of text would appear and if the mouse is on that x position or after,
then it's not over the selected text. This works great for single line
stuff, but obviously can have issues on multi-line stuff if that next
character wraps to the next line. I'm sure I could come up with some kind
of logic to determine that, but I haven't yet because so far we've just been
worried about single-line richtextboxes.
Lance Johnson
> This has always been a problem I don't think there is a good solution.
>
[quoted text clipped - 5 lines]
>>
>> Lance Johnson