Share via


Visual Basic Reference

HelpContextID Property Example

This example uses topics in the Visual Basic Help file to demonstrate 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 TextBox control and a Frame control with an OptionButton control inside of it. Press F5. Once the program is running, move the focus to one of the controls, and press F1.

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

Private Sub Form_Load ()
   App.HelpFile = "VB.HLP"
   Frame1.HelpContextID = winColorPalette
   Text1.HelpContextID = winToolbox
   Form1.HelpContextID = winCodeWindow
End Sub