开发者

C# Richtext box MouseOver

开发者 https://www.devze.com 2023-04-02 09:58 出处:网络
How to get the MouseOver text in a RichTextBox. I have tried using GetCharIndexFromPosition by passing it the cursor location. But it is always giving me the index of a character which is close to the

How to get the MouseOver text in a RichTextBox. I have tried using GetCharIndexFromPosition by passing it the cursor location. But it is always giving me the index of a character which is close to the mouse location, even if I am moving the mouse onto the RichTextBox (开发者_运维百科empty space) it is giving some character index which is closer to the mouse location.


Thanks username. I am able to solve the problem. As you said am comparing the position from char index and actual mouse position. Calculating charcter size using rich text box graphics and adding it to the position of character.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号