The .NET development environment is stocked with native support for HTML Help, which means that you can integrate a .CHM help file to your C# or VB.NET application by using built-in methods without the need to use HTML Help API functions directly.
The Help class available in the .Net environment provides method that you can use to integrate and control a CHM help file from your application. Below are code examples of most frequent actions:
This method will open the specified CHM help file (YourHelpFile.chm) and display the requested topic with the context number equals to 50.
Help.ShowHelp(this, "YourHelpFile.chm", HelpNavigator.TopicId, 50);
This method is mostly used if you simply need to open your CHM file without going to a help topic, so the user will see the Table of Contents tab and the default topic on the right side.
Help.ShowHelp(this, "YourHelpFile.chm", HelpNavigator.TableOfContents, "");
Similarly to the previous method, you can open your CHM help file and display the Index tab.
Help.ShowHelp(this, "YourHelpFile.chm", HelpNavigator.Index, "");
The HelpProvider class allows you to add context-sensitive Help for buttons, text field, and other controls. Thus, you can perform a specific action when the user focuses a control and press the F1 key, or selects the control using the help button from the window's caption bar.
To use this functionality:
It should be pointed out that the value of the HelpKeyword property depends on a specific action you want to perform. For example, if you want a control to show a help topic (when clicking F1 on it), you can set the HelpNavigator property to TopicId, and the HelpKeyword property to the Context Number that should be called.
You can also visit the links below for information on using a CHM file in other development tools.
You can download one of the recommendable help authoring tools that combines a rich feature-set, slight learning curve, and affordable price.