Skip to main content

ToolTipController.BeforeShow Event

Fires when a tooltip is about to be displayed. Allows you to dynamically specify the tooltip text, image, and appearance settings.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v24.1.dll

NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core

Declaration

[DXCategory("Events")]
public event ToolTipControllerBeforeShowEventHandler BeforeShow

Event Data

The BeforeShow event's data class is ToolTipControllerShowEventArgs. The following properties provide information specific to this event:

Property Description
AllowHtmlText Gets or sets whether HTML formatting tags can be used to format the tooltip’s text.
Appearance Gets the tooltip’s appearance settings. This property is not in effect for SuperToolTip objects.
AppearanceTitle Gets the appearance settings used to paint the tooltip’s title. This property is not in effect for SuperToolTip objects.
AutoHide Gets or sets whether the tooltip is hidden after a specific time ellapses.
FlyoutControl Gets a control that should be shown within a flyout tooltip.
HtmlImages Gets or sets a collection of images that you can embed into captions/messages/tooltips in the control using the image HTML-inspired tag.
HtmlTemplate Gets or sets the HTML template that should be used for this specific control.
IconSize Gets the size of the predefined icon to display in the tooltip.
IconType Gets or sets the predefined icon to display in the tooltip.
ImageList Gets or sets the source of images that can be displayed within tooltips.
ImageOptions Provides access to options that specify the raster or vector image displayed in the processed tooltip.
ObjectBounds Gets or sets the bounds of the current object for which a tooltip is displayed.
RightToLeft Gets or sets whether a tooltip’s visual elements are aligned to support locales using right-to-left fonts.
Rounded Gets or sets whether the tooltip window has rounded corners.
RoundRadius Gets or sets the radius of the rounded corners of the tooltip window.
SelectedControl Gets or sets the control for which a tooltip controller’s event is fired. Inherited from ToolTipControllerEventArgsBase.
SelectedObject Gets or sets the element of the control for which the tooltip should be displayed. Inherited from ToolTipControllerEventArgsBase.
Show Gets or sets whether the tooltip should be displayed.
ShowBeak Tests whether callout beaks are displayed for hints.
SuperTip Gets or sets a SuperToolTip.
Title Gets or sets the regular tooltip’s title.
ToolTip Gets or sets the text for the regular tooltip.
ToolTipAnchor Gets or sets whether the tooltip is anchored relative to the mouse pointer or relative to the editor.
ToolTipImage Gets or sets the image to display within the current tooltip.
ToolTipIndent Gets or sets the space, in pixels, between the tooltip and the associated visual element.
ToolTipLocation Gets or sets the location of the tooltip window relative to the position where the tooltip should appear.
ToolTipStyle Gets or sets the look-and-feel settings of the regular tooltip displayed.
ToolTipType Gets or sets the type of tooltip to be displayed.

The event data class exposes the following methods:

Method Description
Equals(Object) Determines whether two objects are equal.
GetHashCode() Gets the hash code (a number) that corresponds to the value of the current object.
GetToolTipLocation() Gets the actual location of the tooltip window relative to the position where the tooltip should appear.

Remarks

The BeforeShow event occurs before displaying tooltips on screen. The event’s parameter provides access to properties that specify the text to display, and the settings defining the tooltip’s look and feel. These properties correspond to members of the ToolTipController class.

You can use the event’s parameter to change the text and appearance of the tooltip and to specify whether the tooltip should be displayed.

The size of the tooltip window is calculated automatically based on the tooltip text which is specified by the ToolTipControllerShowEventArgs.ToolTip property. However, you can handle the ToolTipController.CalcSize event to modify the size and location of the window. This event is fired after the BeforeShow event.

If a tooltip window’s size if modified via the ToolTipController.CalcSize event, the text doesn’t automatically refit into the new size. To fit the text into the new size, custom paint the text as required, by handling the ToolTipController.CustomDraw event.

The following code snippets (auto-collected from DevExpress Examples) contain references to the BeforeShow event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also