Solved

Opening CHM files

Posted on 2004-10-09
4
236 Views
Last Modified: 2009-12-16
I can use the following for the F1 help provider in the statrup to use the F1 key to open my help file but my question is using VB.NET 2002 how do I open the same help file from a button or a menu item?

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
Comment
Question by:teamdad
  • 2
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
Hans Langer earned 500 total points
Comment Utility
Maybe that work:

   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      ShowHelp("ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.3082/vblr7/html/vaoprMultiply.htm") 'URL e.g.
   End Sub


   Public Shared Function ShowHelp(ByVal url As String) As System.Diagnostics.Process
      Dim startInfo As New Diagnostics.ProcessStartInfo
      With startInfo
         .FileName = url
         .WindowStyle = ProcessWindowStyle.Normal
      End With
      Return System.Diagnostics.Process.Start(startInfo)
   End Function

GL
0
 

Author Comment

by:teamdad
Comment Utility
I had to tweak it a little to match my start path but it works great.  I thought that a better way would be with something like Process Start instead of using System Diagnostics?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim hPath As String = Application.StartupPath()
        ShowHelp(hPath & "\Support Files\Help.chm")
    End Sub


    Public Shared Function ShowHelp(ByVal url As String) As System.Diagnostics.Process
        Dim startInfo As New Diagnostics.ProcessStartInfo()
        With startInfo
            .FileName = url
            .WindowStyle = ProcessWindowStyle.Normal
        End With
        Return System.Diagnostics.Process.Start(startInfo)
    End Function
0
 
LVL 10

Expert Comment

by:Hans Langer
Comment Utility
I only know the Process Class from System.Diagnostics namespace.
I think "Inherits System.Windows.Forms.Form"  import the System.Diagnostics namespace.

GL
0
 

Author Comment

by:teamdad
Comment Utility
All I did was the changes to your first post that I commented on and it works great.  I guess as long as it works is all that matters and i'm happy with it.

Thanks a bunch
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now