• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 142
  • Last Modified:

Help with help files

How do you put the help files in a menu option in vb.  I have made the help file but i do not know how to put them on the form so that when the user clicks on the help menu option it pops up the contents of help.  if someone can help or maybe give me a sample program that would be great. thanks

jen
0
nrok829
Asked:
nrok829
1 Solution
 
cwreaCommented:
First, in your VB project's properties (from the Project menu, choose Properties) on the General tab, there is a setting called "Help File Name". Point it to the help file you created.

Next, assuming your help file has context IDs defined, set the context ID for each control and menu item in your form.  When the user has selected one of these controls then presses F1, your help file should be loaded and displayed at the proper context.

If you don't set a HelpContextID for the control, it will open up the help file at the main contents.

In your application, you can also directly launch help by calling the WinHelp API function.  Here's a code snippet from KnowledgeBase article Q202563 on how to call WinHelp from VB:

   Option Explicit
   
   Private Declare Function WinHelp Lib "user32" Alias "WinHelpA" _
      (ByVal hwnd As Long, ByVal lpHelpFile As String, _
      ByVal wCommand As Long, ByVal dwData As Long) As Long

   Private Const HELP_CONTENTS = 3
   Private Const HELP_FINDER = 11

   Private Sub Command1_Click()
      Dim lResult As Long
      Dim sHelpFile As String
      Dim lCommand as Long, lOption as Long
      sHelpFile = "winfile.hlp"
      lCommand = HELP_CONTENTS
      lOption = 0
      lResult = WinHelp(Me.hwnd, sHelpFile, lCommand, lOption)
   End Sub



For more information on using the help system with Visual Basic I suggest looking for the word "winhelp" in MSDN (either CD or online at http://msdn.microsoft.com)


0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now