The Tool Tip Component

The ToolTip component allows you to set tooltips for controls. Tooltips appear in popup windows when the mouse hovers over the control, and they can provide short pieces of information about the control to the user. Important properties of the ToolTip component are described in Table 12-5.

Table 12-5 Important Properties of the ToolTip Component

Property

Description

Active

Indicates whether the ToolTip component is active.

AutomaticDelay

Gets or sets the delay for the ToolTip component.

AutoPopDelay

Gets or sets the period of time the tooltip remains visible if the pointer is stationary on a control with specified ToolTip text.

IsBalloon

Gets or sets a value indicating whether the tooltip should use a balloon window.

ReshowDelay

Gets or sets the length of time that must transpire before subsequent ToolTip windows appear as the pointer moves from one control to another.

ShowAlways

Gets or sets a value indicating whether a ToolTip window is displayed, even when its parent control is not active.

ToolTipIcon

Gets or sets a value that defines the type of icon to be displayed alongside the tooltip text.

ToolTipTitle

Gets or sets a title for the ToolTip window.

UseAnimation

Gets or sets a value determining whether an animation effect should be used when displaying the tooltip.

UseFading

Gets or sets a value determining whether a fade effect should be used when displaying the tooltip.

The ToolTip component also exposes two key methods: GetToolTip and SetToolTip. These methods are used to retrieve and set the tooltip text for a specified control.

When the ToolTip component is correctly configured, tooltips for controls in the form are shown automatically when the mouse hovers over the control. This requires the following:

■ The ToolTipActive property must be set to True.

■ There must be a ToolTip set for that control.

■ The control must be active, or the ToolTip.ShowAlways property must be set to True.

Setting Tooltips for Controls You can set tooltips for controls at either design time or run time. At design time, the ToolTip component creates a design-time property for each control in the form. For example, if you add a ToolTip component named ToolTip1 to your form, each control will gain a design-time property called ToolTip on ToolTip1. This property can be set only at design time and represents the tooltip text for that control.

0 0

Post a comment