Sub OnHelp(Sender: Object; Args: IEventArgs);
Begin
//set of operators;
End Sub OnHelp;
Sender - parameter that returns the component that has generated the event.
Args - parameter that enables the user to determine event parameters.
The OnHelp event occurs when the component is pressed if the mode of help displaying is active or on pressing the F1 button for the active component.
Help display mode is activated by pressing the "?" button if BorderStyle = DialogWithHelp. The EnterContextHelpMode method can emulate pressing this button.
The appropriate methods implemented in the IWinApplicationHelp interface should be used to open the help.
Executing the example requires a form and any components on it. The unique values of the HelpContext property are set for all components. This procedure is set to process the OnHelp event of the form. The folder must contain the Help.chm file.
Sub FormOnHelp(Sender: Object; Args: IHelpEventArgs);
Var
Help: IWinApplicationHelp;
Begin
Help := WinApplication.Help;
Help.Context(Args.ContextId, "Help.chm");
End Sub FormOnHelp;
The Help.chm help file opens when the component is selected and the F1 key is pressed. The appropriate help section is searched by the value of identifier of the help section set for the particular component.
See also:
IWinApplicationHelp