Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Opening CHM files

Posted on 2004-10-09
4
Medium Priority
?
292 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 2000 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

609 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