This sample shows how to use hints to show contextual help.
You can find the MouseOverHints sample project at:
- Start | Programs | Appmethod 1.16 | Samples and then navigate to:
Object Pascal\Multi-Device Samples\User Interface\MouseOverHints
CPP\Multi-Device Samples\User Interface\MouseOverHints
- Subversion Repository:
- Object Pascal: http://sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches/RadStudio_XE8//Object%20Pascal/Multi-Device%20Samples/User%20Interface/MouseOverHints
- C++: http://sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches/RadStudio_XE8//CPP/Multi-Device%20Samples/User%20Interface/MouseOverHints
The MouseOverHints sample demonstrates how to use hints to show contextual help.
The sample shows how to work with hints, and the special behavior that some components, such as status bars, actions, and menus, have when working with hints.
How to Use the Sample
- Navigate to one of the locations given above and open:
- Object Pascal: MouseOverHints.dproj.
- C++: MouseOverHints.cbproj.
- Select the target platform.
- Note: The MouseOverHints sample is supported by desktop platforms, see Platform Support for Hints for further details.
- Press F9 or choose Run > Run.
- Use the check boxes to change the different options and place the mouse over the buttons, menu items, and panel to see hints.
|File in Object Pascal||File in C++||Contains|
The project itself.
The main form where the components are located.
Used to define and implement the sample.
Setting and Showing Hints
- The TControl.Hint property is used to set the hint of a control in the Object Inspector at design time. The TControl.Hint property is also used to change or set the hint of a control at run time.
- The TApplication.ShowHint property is used to enable or disable the hints for the sample application. Disabling the hints of the application disables the hints from all controls.
- The TForm.ShowHint property is used to enable or disable the hints of the form.
- The TControl.ShowHint property is used to enable or disable the hints of a control.
- The TControl.ParentShowHint property is used to set whether the ShowHint of a control is enabled or disabled according to the TControl.ShowHint property of the parent control.
- The TApplication.HintShortCuts property is used to indicate if the hints also display the keyboard shortcuts.
- The GetLongHint method is used to get the long version of the hint. The long version of the hint is the one written after the | (pipe) character.
See more information about enabling hints.
The TActionList component is used to maintain a list of some of the actions used in the sample.
- The TAction.OnHint event is used to set or change the hint of the client control. Setting the hint with
OnHintchanges the hint that displays by default.
See more information about actions and hints.
The TStatusBar control works in a different manner for hints.
- The TStatusBar.AutoHint property is set to
to allow the status bar to intercept all hints from the application.
, the TStatusBar.OnHint event occurs when any hint in the application is triggered.
- The TApplication.Hint property is used to get the text of the current hint.
See more information about status bar and hints.
See more information about menus and hints.