Solved

Opening CHM files

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

777 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