-1

I abandoned CHM HTMLHelp since I could not make it work from shared folders under Win7 at a customer. Now I have a help system for our WinForms application that consists of a myriad of HTML files in a diverse folder structure. The Help is in a folder named "help" next to the executable.

I use the

Help.ShowHelp(Control, HelpUrl, Keyword)

method to display the appropriate HTM file in the HelpUrl parameter. This is, however quite cumbersome, as if the file is renamed or moved to another folder, the help breaks. I wonder if there's another, more appropriate method for HTML file based help?

Daniel
  • 1,391
  • 2
  • 19
  • 40
  • your `HTML file based help` should have **only 1 index.html**, then you can just open that `index.html` using some default browser. BTW, I think `Help` is just for `.chm` files. – King King Oct 10 '13 at 18:21
  • Help is also for HTML files according to MSDN. The question is not about whether it's working or not (because it's working), but maintaining changes and best practices. – Daniel Oct 10 '13 at 18:23
  • Well, it does look like supporting `html` files, **BUT** it ends up calling some default browser to open the `html` files. – King King Oct 10 '13 at 18:29
  • There are tools for that, something like Robohelp. You need to go shopping. Not on topic here. – Hans Passant Oct 10 '13 at 20:40
  • Ditto the index.html - easy to check for broken links. Or... move the HTML into a database and view the content when needed. You could do this is an browser control. Or... look into HTA for displaying the index.htm file - better that using a browser, but it can open security holes as HTA has the same access to the PC as the user does. Or.. use RTF instead of HTML and use the DB approach. – rheitzman Oct 10 '13 at 23:07
  • running CHM's from a server googling 'CHM security' may help – help-info.de Nov 13 '13 at 16:08

1 Answers1

0

Properties to display help (HTML file - local )

Activate the hlpProvider component hlpHtmlLocal and set the HelpNameSpace property of hlpHtmlLocal to the file name you want to work with.

enter image description here

We open a local HTML file with the dialog using the little button to the right.

The next step is to set the HelpNavigator property of a control (e.g. button) to a value of the HelpNavigator enumeration (see table below). Here we use Topic.

enter image description here

When the application is running click the HelpButton to enable "What's this .." Help. The cursor changes. Now click the button or press F1 when the button has focus. This will open the single HTML file in your browser.

It seems you can't use anchor names to jump to a specific part of your HTML file.

Properties to display help (HTML file - Server)

Activate the hlpProvider component and set the HelpNameSpace property of hlpHtmlServer to the file name you want to work with. Here we use a http:// address of a single HTML file. If you provide the file on your company server, you don't have to update the help file with the customer.

enter image description here

The next step is to set the HelpNavigator property of a control (e.g. button) to a value of the HelpNavigator enumaration (see table below). Here we use Topic. Then we set the HelpKeyword on hlpHtmlSever property to e.g. "anchor3". Don't add a leading "#". Leave it empty if you want to open a HTML file without anchors. The Help Handles cmdControl2.Click Dim sHelpFile As String Dim sStartupPath As String '--- Initialize context-sensitive help --- Keyword property provides the key information to retrieve the help associated with the control.

enter image description here

When the application is running click the HelpButton to enable "What's this .." Help. The cursor changes. Now click the button or press F1 when the button has focus. This will open the single HTML file over the Internet in your browser.

help-info.de
  • 6,695
  • 16
  • 39
  • 41