I use HelpNDoc for providing a chm-file for the context sensitive help in my application.
In this software you define a help-ID and a corresponding help-context.
The help-ID for example maybe "SystemSetup" and the help-context is 57.
Now my question:
I can call the help this way:
System.Windows.Forms.Help.ShowHelp(null, @"myhelp.chm", HelpNavigator.TopicId, "57");
and all works well, but can I some how call ShowHelp with the help-ID ("SystemSetup") instead?
I ask this cause the help-context can change, but the help-ID stays always the same.
There is no easy way to do that. The Topic ID is the best thing you have to directly point to a topic. The software we use to generate the CHM files allows names to be given to topics, which can be retrieved using your code.
If that doesn't work for you, and the only thing you have is the name, you might get it done by using the
Topicenum value and the name of the HTML file (if it is distinct enough).Something like this could be what you need (you can retrieve the html file name through an CHM viewer):
I don't know which option is better. That is up to you and your specific scenario.