How can I find out if the cursor is over Selected Text?

  • Thread starter Thread starter SamSpade
  • Start date Start date
S

SamSpade

In a RichTextBox's MouseMove, how can I find out if the cursor is over
selected text ?
 
I don't think there's an exclusive method to do that. However, you can use
GetPositionFromCharIndex(...) and pass in character indices from
SelectionStart to SelectionStart + SelectionLength.

HTH

=vJ
 
Perfect
thanks

Vijaye Rajji said:
I don't think there's an exclusive method to do that. However, you can use
GetPositionFromCharIndex(...) and pass in character indices from
SelectionStart to SelectionStart + SelectionLength.

HTH

=vJ
 
GetCharIndexFromPosition would be a single call, instead of multiple calls for
the
selection range and get you the same information. If your char index was
between
SelectStart and SelectionStart.SelectionLength, then you'd be fine.
 
Thanks, That is what I did.

Justin Rogers said:
GetCharIndexFromPosition would be a single call, instead of multiple calls for
the
selection range and get you the same information. If your char index was
between
SelectStart and SelectionStart.SelectionLength, then you'd be fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top