Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
assaf - 14 Oct 2004 10:40 GMT
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
Sijin Joseph - 14 Oct 2004 13:12 GMT
You can use Control.Cursor property to set the desired cursor for your
control when hovering.

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

> hi all
>
[quoted text clipped - 13 lines]
>
> assaf
assaf - 14 Oct 2004 13:41 GMT
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 can use Control.Cursor property to set the desired cursor for your
> control when hovering.
[quoted text clipped - 20 lines]
> >
> > assaf
Sijin Joseph - 15 Oct 2004 04:40 GMT
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

> hi joseph.
>
[quoted text clipped - 28 lines]
>>>
>>>assaf
assaf - 16 Oct 2004 08:05 GMT
bingo

> You could use a RichTextBox instead of a textbox and then in the hover
> event for the control use RichTextBox.GetCharIndexFromPosition() to get
[quoted text clipped - 42 lines]
> >>>
> >>>assaf

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.