dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: VB7
Expertise: beginner
Dec 23, 2002

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Creating multiline tooltips

In VB6 there was no easy way to create multiline tooltips for form controls, you necessarily had to resort to API tricks. And it was probably just not worth the effort. The good news is that doing this is straightforward in VB.NET! First add a Tooltip Provider control on the form to add the Tooltip On TooltipProviderCtl property to all the controls on the form, and set your tooltip as a single line long text. Finally, go to the code view, within the InitializeComponent method locate the line that set the tooltip, and split the tooltip text with new-line characters, as you would do with any other string. Here's an example:

Me.ToolTipProviderCtl.SetToolTip(Me.Button1, "this is" & environment.NewLine & _
    "a multiline" & environment.NewLine & "tooltip!")
Instead of modifying the code directly in InitializeComponent, you can programmatically set multiline tooltips for your controls in a separate method, called from Form_Load.
Marco Bellinaso
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date