In this post, you’ll learn to use the HelpContext method or DelphiVCL.Application.HelpContext to display the Help topic specified by the numeric context identifier. Learning more about the HelpContext Method will allow you to easily build programs using Python programming software.
Use HelpContext to show the Help topic specified by the numeric context identifier Context and which is from the file specified in the CurrentHelpFile property. HelpContext generates an OnHelp event (either on the active form or on the application object itself). If there is no OnHelp event handler, or if the event handler indicates that HTMLHelp should be called, then HelpContext invokes the HTMLHelp Windows help engine, passing it the context ID specified in the Context parameter.
For example, if the Context value is 714, the HelpContext method displays the help topic with the 714 context ID in the Help file specified by CurrentHelpFile. In the case of a .chm help file, you must map symbolic Context IDs of Help topics to numeric Context values in the [MAP] section of your project (.hhp) file.
HelpContext returns False if CurrentHelpFile is an empty string, meaning the application has no Help file assigned. In all other cases, HelpContext returns True.
In order for the Help 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 files. For information about the native Help handling functions (HTMLHelp or other) and about the data passed to them, see the appropriate HTMLHelp topics in the MSDN Library.
Table of Contents
How do I browse the properties of the DelphiVCL.Application.HelpContext method?
Let’s browse all the properties of the DelphiVCL.Application.HelpContext using dir() command:
1 2 3 |
import DelphiVCL dir(DelphiVCL.Application.HelpContext) |
See the responses in our Windows command prompt:
You can also read short information about the DelphiVCL.Application.HelpContext using the print() command:
1 2 |
print(DelphiVCL.Application.HelpContext) print(DelphiVCL.Application.HelpContext.__doc__) |
See the responses in our Windows command prompt:
Check out DelphiVCL which easily allows you to build GUIs for Windows using Python.