Document! X provides rich support for linking to the generated help system from your application or from Visual Studio and other development environments.
Recent development tools use topic file names instead of Help Context Ids to support F1 help. In that scenario you can use the help file name and the topic name, with a .html suffix, as the help target.
Adding F1 support to a Visual Studio .NET Winforms project
Displaying a help topic in code
The shared Help class offered by the System.Windows.Forms name space allows you to display your help Topics. You can use the ShowHelp method to display a topic. The Url parameter of this method should be filled with your CHM filename, and the param parameter with the name of your topic and the .html suffix.
For example, assuming you had a HelpProvider control already initialized named ContextHelp, and you wished to display a topic named default, you could call the following code:
Visual Basic .NET |
Copy Code |
---|---|
' display the how to topic Help.ShowHelp(Me, ContextHelp.HelpNamespace, HelpNavigator.Topic, "default.html") |
C# |
Copy Code |
---|---|
// display the how to topic Help.ShowHelp(this, ContextHelp.HelpNamespace, HelpNavigator.Topic, "default.html"); |
Development environments such as unmanaged Visual C++, Visual Basic 6 and older versions of Delphi using numbers to associate elements of an application to topics in the help system. If that is your situation you can use tools within Document! X to assist with the mapping of context ids to topics.
Depending on your development approach you might already have context ids assigned in your application and want to map those to topics, or you might want to generate a set of context ids from your topics so that the developers can assign those to user interface elements.
To map existing context ids to Topics
Follow this procedure to map existing context ids that the application development team have already assigned to user interface elements.
To assign context ids to Topics and generate a context id .h file
Follow this procedure if the application development team have not already assigned help context ids to user interface elements and wish to have you provide a .h file containing a context id for each Topic in the project which they can then assign to user interface elements.
Once you have established the mapping between help context ids in the application and the Topics in your help system, all that remains is to set the help file name in your application. You should therefore liase with your development team to agree the output .chm filename to use for the help system so that when F1 is pressed in the application it is looking for the correct .chm file name.
.NET reference documentation topics generated by Document! X automatically contain the necessary information to support F1 help. Once your help system has been deployed to the users of your .NET assembly, they can simply press F1 with the edit cursor over a type or member in your assembly to show the related documentation page.
F1 support is automatically generated for Help 2.x outputs (if you are targetting Visual Studio 2002-2008) and Microsoft Help Viewer outputs (for Visual Studio 2010, 2012, 2013, 2015 or 2017 RC ).
If you are producing an AddIn or Tool that integrates with Visual Studio and you want to provide links to your help system, you will need to define F1 keywords. You can find more background information on Help Integration with Visual Studio in the MSDN Library.
To add an F1 keyword to a Topic:
Once the F1 keyword has been defined for the Topic and the generated help system is deployed, F1 requests for that keyword from your Visual Studio integrated Tool or AddIn will display the Topic against which you defined the F1 keyword.