[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Forms' (#lcl)

# THintWindow.ActivateHint

Shows the hint window with the specified hint text.

## Declaration

Source position: forms.pp line 1015

`public procedure THintWindow.ActivateHint(`
`const AHint: string`
`); procedure THintWindow.ActivateHint(`
`ARect: TRect;`
`const AHint: string`
`); virtual;`

## Arguments

`AHint` |  | Text displayed in the hint window.

## Arguments

`ARect` |  | TRect with the display area for the hint window.
`AHint` |  | Text displayed in 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.

Remark: | 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

THintWindow.ActivateWithBounds |  | Sets the bounds in HintRect and activates the hint window.
THintWindow.ActivateHintData |  | An alternate version of ActivateHint with additional data used for the hint display.
THintWindow.ActivateSub |  | Sets the bounds for the hint window and configures the auto-hide timer.
THintWindow.CalcHintRect |  | Determines the display rectangle needed the specified hint text.
THintWindow.HintRect |  | Contains the bounds used to display the text for the hint.
THintWindow.SetBounds |  | Applies the argument values to the bounds for the control.