Vcl.Forms.TApplication.OnHelp

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnHelp: THelpEvent read FOnHelp write FOnHelp;

C++

__property THelpEvent OnHelp = {read=FOnHelp, write=FOnHelp};

Properties

Type Visibility Source Unit Parent
event public
Vcl.Forms.pas
Vcl.Forms.hpp
Vcl.Forms TApplication

Description

Occurs when the application receives a request for Help.

Write an OnHelp event handler to perform special processing when the user requests Help. The HelpContext and HelpJump methods automatically trigger the OnHelp event.

The THelpEvent type has the following parameters: CallHelp, Command, and Data.

Set CallHelp to true if the application should still invoke the Help system after the event. Set CallHelp to false to prevent the default response given by the Help system. All application Help methods go through OnHelp. The application calls the Help system only if OnHelp's CallHelp parameter is true or if no OnHelp event handler is assigned.

The event handler returns True if it succeeds, False if it fails.

The possible values for the Data parameter depend upon the value of the Command parameter. To find the possible values of the Command and Data parameters, see the appropriate HTMLHelp topics in the MSDN Library.

In order for the OnHelp event handler to work properly, insert in the uses clause of your application the Vcl.HtmlHelpViewer or another unit that provides an interface to the external Help viewer to use. The Vcl.HtmlHelpViewer unit provides a Delphi interface to the HTMLHelp Windows native Help handling function. For C++, you need to include the HTMLHelpViewer.hpp header file.

Note: You can also respond to this event using the TApplicationEvents component, which allows you to assign an event handler using the IDE.

See Also

Code Examples