how to change the cursor to arrow when hovering over selected text?

  • Thread starter Thread starter assaf
  • Start date Start date
A

assaf

hi all

i wrote a simple text editor.
i am able to select text,
and drag/drop it onto other text editors.

however, when the mouse hovers over the selected text,
before draging it,
it remains an IBeam.

this is not desireable behaviour.
users expect the cursor to change into an arrow,
when hovering over selected text.

how do i change the cursor to arrow, when hovering over selected text?


assaf
 
hi joseph.

my question is:
how do i know that i am hovering over the selected text?
so that i will know to change the cursor into an arrow?


assaf
 
You could use a RichTextBox instead of a textbox and then in the hover
event for the control use RichTextBox.GetCharIndexFromPosition() to get
the index of the char where the mouse is currently at and then use
SelectionStart property to determine if the index falls within selected
text.

Also i came across this enhanced texteditor control, you may want to
give it a try
http://sf.net/projects/wangdera

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
 
bingo


Sijin Joseph said:
You could use a RichTextBox instead of a textbox and then in the hover
event for the control use RichTextBox.GetCharIndexFromPosition() to get
the index of the char where the mouse is currently at and then use
SelectionStart property to determine if the index falls within selected
text.

Also i came across this enhanced texteditor control, you may want to
give it a try
http://sf.net/projects/wangdera

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
 
Back
Top