HelpFile Property

See Also1LL93XN                 Example9CISP>Low

Applies To

App object5QU20R2, common dialog1H1HYJI.

Description

Determines the name of the Microsoft Windows Help file for an application.

Usage

{ [form.]cmdialog|App}.HelpFile[ = filename]

Remarks

If you've created a Microsoft Windows Help file for your application and set the application's HelpFile property, Visual Basic automatically calls Help when a user presses the F1 key.  If there is a context number in the HelpContextID764PDR property for either the active control or the active form, Help displays a topic corresponding to the current Help context; otherwise it displays the main contents screen.

 

Note   Building a Help file requires the Microsoft Windows Help Compiler, which is available with the Visual Basic Professional Developer's Edition.

 

Data Type

String7WSH0XQ


See Also

Help:

HelpContextID Property764PDR

 

Visual Basic Professional Developer's Edition:

Help Compiler Guide


HelpContextID, HelpFile Properties Example

The example uses topics in the Visual Basic Help file and demonstrates how to specify context numbers for Help topics.  To try this example, paste the code into the Declarations section of a form that contains a text box and a frame with an option button inside the frame.  Then press F5.  Once the program is running, move the focus to one of the components and press F1.

' Actual context numbers from the Visual Basic Help file.
Const winColorPalette = 21004      ' Define constants.
Const winToolbox = 21001
Const winCodeWindow = 21005

Sub Form_Load ()
  App.HelpFile = "vb.hlp"
  Frame1.HelpContextID = winColorPalette
  Text1.HelpContextID = winToolbox
  Form1.HelpContextID = winCodeWindow
End Sub