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

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
 
A

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
 
S

Sijin Joseph

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
 
A

assaf

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
 

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

Top