Home
C#.WinForms
ToolTip Example
Updated Sep 6, 2023
Dot Net Perls
ToolTip. This control makes interfaces more intuitive. We add the ToolTip control to a Windows Forms application, which provides useful contextual hints to the client.
Getting started. We use Visual Studio to add ToolTips. First, to add a ToolTip control to your Windows Forms application, open the ToolBox panel in Visual Studio's designer.
Set ToolTip property. Once added, each control, such as Buttons and TextBoxes, will acquire a "ToolTip on toolTip1" property. We adjust this property to set ToolTip text.
Detail Add a Button named button1 to the Windows Forms window in the Designer. This will now have the ToolTip property.
Next Select the Button in the Designer view. Scroll down to the ToolTip on toolTip1 row, and add some text.
Active:
This allows you to specify if the ToolTip is available to be opened or shown

AutomaticDelay:
This property allows you to specify the number of milliseconds after the user hovers over the ToolTip before it is shown

AutoPopDelay:
This property lets you specify how long in milliseconds a ToolTip will remain on the screen if the mouse is frozen

BackColor, ForeColor:
You can set the background and foreground of your ToolTip
It is usually best to avoid changing these

InitialDelay, ReshowDelay:
These attributes let you specify the exact delays in milliseconds

ToolTipIcon, ToolTipTitle:
Allow you specify an image to display on the tooltip, and a title to display

Animation, UseFading:
These properties let you specify the visual effects used on your tooltips

IsBalloon:
You can specify a balloon tip with the IsBalloon property
Methods. It is possible and sometimes useful to write ToolTip code in C# code. Often, ToolTips that use IsBalloon will need to have custom C# or VB.NET code.
Tip The Show method forces the tip to be displayed. The Hide method forces a ToolTip to disappear.
And The Get and SetToolTip methods let you assign tooltips programmatically to controls.
A summary. Windows Forms programs have easy-to-use ToolTips. Ideally, you can implement your tips entirely in the Designer, keeping all the code out of your private implementation.
Dot Net Perls is a collection of pages with code examples, which are updated to stay current. Programming is an art, and it can be learned from examples.
Donate to this site to help offset the costs of running the server. Sites like this will cease to exist if there is no financial support for them.
Sam Allen is passionate about computer languages, and he maintains 100% of the material available on this website. He hopes it makes the world a nicer place.
This page was last updated on Sep 6, 2023 (edit).
Home
Changes
© 2007-2025 Sam Allen