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 / April 2005

Tip: Looking for answers? Try searching our database.

Mouse over text in richtextbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lance Johnson - 07 Apr 2005 15:56 GMT
I can't seem to find out if the mouse cursor is over text in a richtextbox.
I can use GetCharIndexFromPosition but all that does is tell me the closest
character.  But if the cursor is outside the range of current text, there's
no way to calculate that.  I'm sure there should be something to tell me how
to do this, but I can't seem to find it.

Lance Johnson
Stoitcho Goutsev \(100\) [C# MVP] - 08 Apr 2005 02:50 GMT
This has always been a problem I don't think there is a good solution.

Signature

Stoitcho Goutsev (100) [C# MVP]

>I can't seem to find out if the mouse cursor is over text in a richtextbox.
>I can use GetCharIndexFromPosition but all that does is tell me the closest
[quoted text clipped - 3 lines]
>
> Lance Johnson
Lance Johnson - 08 Apr 2005 16:47 GMT
Well crap.  Basically what I did was calculate where the character after the
end of text would appear and if the mouse is on that x position or after,
then it's not over the selected text.  This works great for single line
stuff, but obviously can have issues on multi-line stuff if that next
character wraps to the next line.  I'm sure I could come up with some kind
of logic to determine that, but I haven't yet because so far we've just been
worried about single-line richtextboxes.

Lance Johnson

> This has always been a problem I don't think there is a good solution.
>
[quoted text clipped - 5 lines]
>>
>> Lance Johnson

Rate this thread:







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.