HelpProvider & HTML Help Workshop Use Guide
Adding Help to a Windows Forms application is poorly documented.
Significant questions don’t have good documentation or samples. i.e.:
- What tool or project type do you use to create the help?
- If you have a budget for it, you buy a tool such as RoboHelp.
- Or you can use the “HTML Help Workshop” which doesn’t appear to be a standard part of Visual Studio. It can be downloaded from MSDN downloads.
- What syntax do you provide for the string fields set in the HelpProvider object?
HelpProvider is a glue class that contains a number of hashtables to externally add help related properties to windows forms controls.
The HelpNamespace string property identifies a help system and must be set to use HelpKeyword/HelpNavigator. It is NOT a namespace. It can be a uri or local file name or possibly other things as well.
The four directly manipulated hashtable properties are:
· ShowHelp – a Boolean flag that enables the display of help through the HelpProvider.
· HelpString – a string to display in a pop-up window. Typically activated by clicking on the control when the cursor is a “?” or when the control has focus and HelpNamespace is null.
· HelpKeyword – a string to identify the help request passed to a help system. Optional. Used to steer a help system to the correct point.
· HelpNavigator – an enumeration value that guides the help system in what to do with the HelpKeyword.
A fifth hashtable stores references to the controls that are participating in this HelpProvider’s services.
The HelpProvider registers event handlers on the control’s HelpRequested and QueryAccessibilityHelp events if enabled and minimally configured.
- How do you invoke your help system from a “Help…” menu pick?
The Help class provides the actual methods for displaying help.
Help.ShowPopup(parent, string, point)
Help.ShowHelp(parent, helpNamespace[, helpNavigator[, helpKeyword]])
- What’s the syntax and semantics on HelpNamespace?
- If HelpNamespace uses “http:” or “https:” schemes then only HelpNavigator.Topic can be used which appends “#”+HelpKeyword onto HelpNamespace.
b. If HelpNamespace is a compiled html help file (“.chm”) then HelpNavigator is interpreted as follows:
· Topic – HelpKeyword is the filename plus optional anchor. i.e. “welcome.htm#anchor3”.
· KeywordIndex – Actually displays topic linked to HelpKeyword by the index.
· Index – Enters all of HelpKeyword in the index “find” textbox but doesn’t display the topic.
· AssociateIndex – Enters just enough of HelpKeyword into the index “find” text box to get a unique hit, doesn’t display the topic.
· TableOfContents – Displays the table of contents. Appears to ignore HelpKeyword.
- How do you hide the TOC/Index/Find pane when displaying a topic via KeywordIndex or Topic?
- Annoying bugs in HTML Help Workshop
- If you open the .hhp project file by command line with double quotes around the filename it opens fine but will be unable to save changes. Open the same file by double clicking on it and things are fine.
- If you have syntax errors in your html – for example a missing closing quote in a src attribute – the program exits without any error messages when you compile.
- You have to add a “Window Style” to the project to get control over what tabs appear in the navigation pane, whether it’s hidden by default, what the window title is, etc.
- The advantage of using a HelpNavigator mode of KeywordIndex instead of Topic is the level of indirection avoids hard coding page names and anchors into the applications source code. However the Index tab remains visible.
- What’s the best way to build an index?
- Use the Edit?Compiler Information… command