Document! X and HelpStudio Bundle 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 have a HelpProvider control already initialized named ContextHelp, and you want to display a topic named default, you can 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"); |
If you have 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, you can use tools within Document! X and HelpStudio Bundle 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 and HelpStudio Bundle 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 2017, 2019, or 2022).
If you are producing an AddIn or Tool that integrates with Visual Studio and you want to provide links to your help system, you 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 displays the Topic against which you defined the F1 keyword.