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

How to access help files

I am new to VB.NET 2002.  I have a question about using CHM "Help Files" and I haven't found information anywhere on the Internet that I have understood or that has helped me so far. When my program is installed the packager will ask the user what directory they want the software installed to. Default will be C:\Program Files\Lexco and the support files including the help file will be in C:\Program Files\Lexco\Support Files but if the user changes it to another directory then I would need my program to be able to find the Support Files directory for the Help.chm file so it could be used.  

My question: In my code how to I account for this when pointing to my support files such as the Help.chm?  A simple commented working example using the F1 Help Provider would be great.

Thanks,

0
teamdad
Asked:
teamdad
  • 3
  • 3
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
You can use Application.StartupPath to know from which folder your application is running.

Me.helpProvider1.HelpNamespace = Application.StartupPath & "\YourFile.chm"
0
 
Éric MoreauSenior .Net ConsultantCommented:
or
Me.helpProvider1.HelpNamespace = Application.StartupPath & "\support\help.chm"
0
 
teamdadAuthor Commented:
emoreau,

Thank you for the quick reply, I have a F1 help provider on my form and have used your code but in the debug mode it don't bring up the help file.  I have watched for spelling errors and tried the Help.chm in the bin folder since it would be the application startup path and it still won't pull up. Is it something i'm doing?



I also have a post for assistance with embedded fonts if you are interested.
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21150219.html
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Éric MoreauSenior .Net ConsultantCommented:
have you set the ShowHelp to true for all controls?
0
 
teamdadAuthor Commented:
Yes. For the MenuItem and the form.
0
 
teamdadAuthor Commented:
I had to make some adjustments to the code you gave me but now it works great!!

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim hPath As String = Application.StartupPath()
        Me.HelpProvider1.HelpNamespace = hPath & "\Support Files\Help.chm"
    End Sub
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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