Show: Delphi C++
Display Preferences

Vcl.Controls.TControl.Hint

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Hint: string read FHint write FHint stored IsHintStored;

C++

__property System::UnicodeString Hint = {read=FHint, write=FHint, stored=IsHintStored};

Properties

Type Visibility Source Unit Parent
property published
Vcl.Controls.pas
Vcl.Controls.hpp
Vcl.Controls TControl

Description

Hint contains the text string that appears when the user moves the mouse over the control.

Use the Hint property to provide a string of Help text either as a Help Hint or as Help text on a particular location, such as a status bar.

A Help Hint is a box containing Help text that appears for a control when the user moves the mouse pointer over the control and pauses momentarily.

To set up Help Hints

  • Specify the Hint property of each control for which a Help Hint should appear.
  • Set the ShowHint property of each appropriate control to True, or set the ParentShowHint property of all controls to True and set the ShowHint property of the form to True.
  • At run time, set the value of the application's ShowHint property to True.
  • To show the Hint on a status bar or another location, use the OnHint event handler of the application. The application's OnHint event occurs when the mouse pointer moves over the control.
  • Specify a hint to be used for both a Help Hint box and by an OnHint event handler by specifying values separated by a | (pipe) character.

For example,

Edit1.Hint := 'Name|Enter Name in the edit box|1';
Edit1->Hint = "Name|Enter Name in the edit box|1";

Here:

  • The Name part is the short hint and appears at the top of the Help Hint box.
  • Enter full name in the edit box is the long hint and appears below the short hint. It can be extracted using the GetLongHint function for use in an OnHint event handler.
  • 1 is an optional image index in an image list in the Images property of the control and specifies the index of the image to appear in the hint.

If Hint contains only one value, the entire string is used as a Help Hint and returned by the GetLongHint and GetShortHint functions. If a control has no Hint value specified, but its parent control does, the control uses the value of the parent control (as long as the control's ShowHint property is True).

Note: If the application's ShowHint property is False, the Help Hint does not appear, but the OnHint event handler is still called.

See Also

Code Examples

Personal tools
In Other Languages
Previous Versions
Assistance