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.

Tooltip for text extending beyond control bounds

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rangi Keen - 26 Oct 2004 15:58 GMT
Is there a method to display a tooltip for text that is truncated on screen
similar to the way the Windows Explorer tree control does? I don't see any
method in the ToolTip class that would allow me to position it to line up
with the underlying control text rather than showing at the default location
below and to the right of the mouse.

Here are some of the properties I'd like in such a tool tip (essentially the
same as those in the Windows Explorer tree or other similar controls such as
data grids):
* Appears when moving the mouse over the text when the length of the text
exceeds the bounds of the area in which it is displayed
* Appears over the existing text so that the text in the tool tip is in the
same location as the text in the control
* Extends as far as necessary to the right to include all text in the
control (up to the width of the screen at least)
* Extends beyond the bounds of the current application (not truncated when
reaching the right side of the application window or containing form)
* When the user clicks the mouse, the underlying control receives the click,
not the tool tip object.

Thanks,
Rangi
"Jeffrey Tan[MSFT]" - 27 Oct 2004 04:19 GMT
Hi Rangi,

Actually, Windows Explorer tree is a standard treeview control of windows.
And the truncatable tooltip of Windows Explorer tree is the default
behavior of TreeView control. If you drag a normal treeview to the form,
then add some treenodes to the treeview with long text, you will see if the
treenode text is truncated, the tooltip will display when mouse over.

But for normal control, the standard tooltip behavior does not work like
this. And the tooltip component does not give us any feature of doing this.
If you really want to get such function, I think we have to invent all the
things ourselves.

First, we need some information on whether the control's text is
truncated(because we only want to display the tooltip when the text is
truncated). This need some help of the underlying control author, so the
more reasonable way is that we only add this function for certain(our)
control, and we are the author of the control, then we can get whatever
information we needed. Then we just need to listen to the mouse message,
and draw the tooltip like window on the text.(Also, we should erase the
tooltip when the mouse move out or use click the tooltip)

All in all, there is no build-in support for normal control of this
tooltip, we have to invent all the things. I suggest you take the standard
tooltip behavior of windows, this will give customer a consistent UI view
and experience for all other windows controls.
=================================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


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.