Visual Basic Development Bookmark and Share   
 Home > Visual Basic Language > CUSTOM tooltips in VB.NET (bold, italic ...)
 

CUSTOM tooltips in VB.NET (bold, italic ...)

Well it's not a major problem but it visually would look better I have a text line wich cannot fit in control wich i am displaying it so when mouse hovers over that text it is shown in a tooltip Text exmp: Name: John ,Last Name: ... and so onIs there any way tomake part of my tooltip bold? Name: John ,Last Name: ... like this? Thank you for your answers and time.
Auris  Friday, June 16, 2006 8:13 AM
The only text-box that seems to give much text formatting is the RichTextBox.
You can make use of Bold, Colors, highlighting etc , and also select the screen position (Left, top). If you already have the text+formatting, you could make an rtf file in Word and Load it into the Box: RichTextBox1.LoadFile("c:\subdir\RichTextFile2.rtf"). Otherwise you will have to make it in code.

So instead of the limited Tooltip, you could have a fancy RichTextBox that is Visible on the MouseHover event of your control, and Visible=False for the MouseLeave event.
HemeFlasher  Friday, June 16, 2006 12:37 PM

This link has an excellent example

http://www.vbaccelerator.com/home/NET/Code/Controls/Popup_Windows/Floating_Controls/article.asp

Just set the font before DrawString in OnPaint of the FloatControl

Karthik Krishnaswami  Friday, June 16, 2006 9:14 AM
The only text-box that seems to give much text formatting is the RichTextBox.
You can make use of Bold, Colors, highlighting etc , and also select the screen position (Left, top). If you already have the text+formatting, you could make an rtf file in Word and Load it into the Box: RichTextBox1.LoadFile("c:\subdir\RichTextFile2.rtf"). Otherwise you will have to make it in code.

So instead of the limited Tooltip, you could have a fancy RichTextBox that is Visible on the MouseHover event of your control, and Visible=False for the MouseLeave event.
HemeFlasher  Friday, June 16, 2006 12:37 PM

Well I thought about that Thanks for it anyway, but just wodering isn't there any simplier way to this Because with rtf i need to specify coordinates where to show a tooltip on each LISTVIEW item when i hover over it. If no more ideas will show up i guess i'l go with richtextbox.

Auris  Friday, June 16, 2006 12:44 PM
I consider the possibility to specify the coordinates an advantage.

It is easier for a command button since you already have the coordinates, but with the line number of the ListView (and a little trial and error) you should be able to place it where you want.

I found this method quite useful on the HScrollBar to show useful info in the textbox as the cursor was dragged. But in this case, I only need to place it a bit left or right of the cursor being dragged.

HemeFlasher  Friday, June 16, 2006 12:54 PM

I wrote an article discussing this very topic. The answer is yes, you can do exactly what you are looking to do. To see a real-world example of custom tooltips (using the information from the article), there is a picture located at: http://addressof.com/blog/archive/2006/06/25/11888.aspx. The article is located at: http://addressof.com/blog/articles/ToolTipVoodoo.aspx.

CorySmith  Thursday, July 06, 2006 2:44 PM

You can use google to search for other answers

Custom Search

More Threads

• Database Alternatives
• Cookies are not retain in a new I.E. Browser window if created from a winform using AxSHDocVw.AxWebBrowser or WebBrowser.
• Raising events
• Wizard Manager in vb.net (like vb6)
• Get image from web page with vb.net
• in Button1_ServerClick i need to show a table written in HTML div
• Application level Date format and culture info
• Getting the dockstate of my notebook
• Adding characters between characters in a line of text
• Haw to Create Folder and share