Solved

Opening CHM files

Posted on 2004-10-09
4
247 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

920 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

15 Experts available now in Live!

Get 1:1 Help Now