Sign in Join
FPDoc Onlineexperiment

THintWindow.ActivateHint procedure

Member of THintWindowpublicIn unit Forms

Shows the hint window with the specified hint text.

Declaration

pascal
procedure ActivateHint(const AHint: string)
procedure ActivateHint(ARect: TRect; const AHint: string); virtual

Arguments

AHint

Text displayed in the hint window.

ARect

TRect with the display area for the hint window.

Description

ActivateHint is an overloaded procedure used to display a pop-up hint window with the text specified in AHint. ActivateSub is called to set the bounds for the hint window to the values in HintRect, display the hint window, and enable its auto-hide timer.

No actions are performed in the method if ActivateHint has been previously called with the same hint text (Caption) and display area in HintRect.

An overloaded variant allows the display area for the hint window to be specified using its ARect argument. This variant updates HintRect to the argument value and ensures that the display rectangle for the hint window fits within the work area for the monitor where the hint window is located. Member values in HintRect are adjusted as needed to position the window before it becomes Visible.

ActivateHint is used in the implementation of methods like ActivateWithBounds and ActivateHintData.

Use CalcHintRect to get the display rectangle for a hint window with a specified width, hint text, or other associated hint data.

Example usage:

HintWindow := THintWindow.Create(nil);
Rect := HintWindow.CalcHintRect(0,'This is the hint', Nil);
HintWindow.ActivateHint(Rect,'This is the hint');

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.