Solved

Opening CHM files

Posted on 2004-10-09
4
279 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
Hans Langer earned 500 total points
ID: 12269095
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
ID: 12269122
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
ID: 12272636
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
ID: 12272794
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

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

726 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