ToolTipController Component
- 3 minutes to read
The ToolTipController component provides centralized management for the appearance and behavior of hints in DevExpress controls and any other controls. The functionality of the tooltip controller is encapsulated by the ToolTipController class. This topic provides general information on the ToolTipController component and lists the main settings that affect tooltip appearance.
ToolTip Controller
The ToolTipController provides properties that allow the appearance and behavior settings of tooltips to be customized. The ToolTipController component must be bound to a control in order to enable tooltip management. So if multiple controls are bound to the same ToolTipController, they will all have the same look-and-feel and behavior.
Note
DevExpress controls do not necessarily need to be bound to a ToolTipController component. If they are not bound to a ToolTipController, the tooltips for these controls are handled by the static Default ToolTipController. See the section below for more information.
Usually a tooltip’s contents (title, text and icon) are determined by the control that the tooltip is displayed for. However, ToolTipController exposes the events to dynamically customize the contents and appearance of tooltips for any control and control’s element.
The following table lists the main properties and events declared in the ToolTipController class.
Property, event | Description |
---|---|
ToolTipController.Appearance | Specifies the appearance settings for tooltips. |
ToolTipController.AppearanceTitle | Contains the appearance settings of a tooltip’s title. |
ToolTipController.AutoPopDelay | The time interval specifying how long a tooltip is displayed for. |
ToolTipController.IconSize | Specifies the size of the icon displayed within a tooltip. |
ToolTipController.InitialDelay | Specifies the time lapse between placing the cursor on a visual element and a tooltip being displayed. |
ToolTipController.Rounded | Specifies whether a tooltip’s corners are rounded or not. |
ToolTipController.RoundRadius | Specifies the radius of a tooltip’s rounded corners. |
ToolTipController.ShowBeak | Specifies whether callout beaks are displayed for hints or not. |
ToolTipController.ShowShadow | Specifies whether tooltips are shown shadowed. |
ToolTipController.ToolTipLocation | Specifies a tooltip’s location. |
ToolTipController.BeforeShow | Enables you to customize the text and settings of a tooltip before displaying it onscreen. |
ToolTipController.CalcSize | Enables you to specify the position and size of a tooltip’s window. |
ToolTipController.CustomDraw | Enables you to custom paint a tooltip’s region. |
Example:
How to: Customize Tooltips for XtraGrid and CheckBox Using the ToolTipController
Default ToolTip Controller
It is not necessary to place a ToolTipController component onto a form and bind it to controls in order to enable hint customization and management. Instead you can use the Default ToolTipController component that manages tooltips for any control by default. In code, the Default ToolTipController can be accessed via the static ToolTipController.DefaultController property. To access it at design time, place the DefaultToolTipController component onto a form.
You can customize the settings and subscribe to events of the Default ToolTipController in the same manner as for the regular ToolTipController component.
A note for the DevExpress controls and components that provide the ToolTipController property: if this property is set to an instance of the ToolTipController type, the tooltips for this control will be handled by the assigned ToolTipController and not by the Default ToolTipController.
Example:
How to: Customize Tooltips Using the Default ToolTipController
Scenarios of Using the ToolTip Controller
The following table lists the common scenarios to customize tooltips for controls.
Task | Scenario(s) |
---|---|
Provide centralized management for tooltips for all controls within an application. | Use the Default ToolTipController. |
Customize tooltips differently for different controls. |
|