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.
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.
ToolTip
propertyOnce added, each control, such as Buttons and TextBoxes
, will acquire a "ToolTip
on toolTip1
" property. We adjust this property to set ToolTip
text.
Button
named button1 to the Windows Forms window in the Designer. This will now have the ToolTip
property.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
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.
ToolTip
to disappear.SetToolTip
methods let you assign tooltips programmatically to controls.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.