How To: Integrate NetHelp in a .NET Application

NetHelp 2.0, Doc-To-Help’s browser-independent help format, supports context sensitive help that can be used in many ways: on web pages, in web applications and in client applications on any platform written in any programming language.

NetHelp 2.0 context sensitive help uses the same context IDs assigned to topics in your project as do the HTML Help and WinHelp targets. You may look into Implementing Context Sensitive Help for more information.

To call NetHelp 2.0 from your application or web pages, use one of the D2H_ctxt.* source files provided with Doc-To-Help; they define the ShowHelp function needed to enable context-sensitive help.

Note: The D2H_ctxt.* files are installed by default in the \\Program Files [or Program Files (x86)]\ComponentOne\DocToHelp\Context-Sensitive Help folder.

You can read more about integrating documentation in your application, in this blog.

In this blog, we create a basic .NET application using a web browser control to show/embed  NetHelp.

Here’s some code:

private void btn_NetHelpTarget_Click(object sender, EventArgs e)
{
string url = "file://C:/Users/<username>/Documents/My Doc-To-Help Projects/Test-NEw/NetHelp/index.html"; //Path of NetHelp
NetHelp.Query query = new NetHelp.Query(NetHelp.QueryTypes.ContextID, "367" ); //Query to define the call to NetHelp
NetHelp.Parameters param = new NetHelp.Parameters(NetHelp.Tabs .Default);
NetHelp.ContextSensitiveHelp.ShowHelp(query, param, url, WebBrowser); //Embedding NetHelp in web browser
}

You may change Query type as per your requirement, which would depend upon

  1. ContextID
  2. Group
  3. TopicUrl
  4. Keyword

For e.g, if you need to call the topic directly, then your Query would be modified as

NetHelp.Query query = new NetHelp.Query(NetHelp.QueryTypes.TopicUrl, "documents/topic3.htm");

You may download the following sample for complete implementation.

Download Sample

Leave a Reply