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.
 
Back
Top