the12thplaya
01-10-2005, 06:07 AM
How can I open a HTML file from a MenuItem please? Almost all programs have a Help Button on the Main Menu bar which opens either a Help program or the users default browser and loads html files installed with the program. I want to do the latter I have the help pages created, but cant seem to find a way to open them from my program
Thanks
AtmaWeapon
01-10-2005, 09:46 AM
Here's how I've been doing it. I make no claims that this is the best way, and in fact I suspect if I would take the time the HelpProvider object may be what should be used, but this works.
Private Sub miHelpContents_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles miHelpContents.Click
Dim pathToHelpFile As String = "help file.chm"
If Not IO.File.Exists(pathToHelpFile) Then
'Error happens if file doesn't exist
Else
'launches the help file
Process.Start(pathToHelpFile)
End If
End Sub
the12thplaya
01-10-2005, 01:59 PM
Here's how I've been doing it. I make no claims that this is the best way, and in fact I suspect if I would take the time the HelpProvider object may be what should be used, but this works.
Private Sub miHelpContents_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles miHelpContents.Click
Dim pathToHelpFile As String = "help file.chm"
If Not IO.File.Exists(pathToHelpFile) Then
'Error happens if file doesn't exist
Else
'launches the help file
Process.Start(pathToHelpFile)
End If
End Sub
Hey it's short and sweet and if it works then it's good enough for me :) I will have to give it a try. Thanks