30. December 2008 09:41
Some time ago, I was looking for a simply component to let me easily implement context sensitive help without requiring me to fully rewrite the application (dropping the help components on each form, set the help context of all the controls, etc). After a short search, I found this article on CodeProject by Tom Clement. The article is great, but not what I was looking for. I still had to derive every form in my application (which contains a lot of forms) from a custom form class that contains the help component. But hey, it's better than the alternative (adding all help components manually to all forms).
However, when I searched the comments, I found a link to a great new article by Wiktor Zychla. He made some great improvements by creating a Help Component that you can simply drop onto your main form. Then, everything happens as it is magic. That was exactly what I was looking for!
After working with the control for a while, I noticed that I wanted some improvements. What I changed can be found below:
(+) Added combobox to editor form so a help file can be selected from a list
(*) Translated UI to English
(*) Help files must be located in a subdirectory Help (constant defined in Constants.cs)
(x) The files are now opened in read-only mode so this component will also work on Vista without elevation
You can download the updated source here: CatenaLogic.Help.zip (24.10 kb) [Downloads: 1034]
Even though the namespace has changed to CatenaLogic.Help, all credits still go to Tom Clement and Wiktor Zychla. I just made some small improvements.
This is how to use the control:
- Recompile the library from the provided source
- Put the HelpComponent on the main form of your application
- Run the application with helpprovider commandline parameter
- Use Ctrl+F1 to map help topics to controls. Remember about the hierarchy - you do not have to provide topics for all controls, it is sufficient to provide the topic for a container control and all its child controls inherit the mapping.
- Remember to provide a help file name (must be a *.chm file located beside the application main executable)
- When the mapping is complete, include the help.mapping file stored beside the application main executable as an embedded resource in one of assemblies
- Remove the help.mapping file located beside the application main executable
- Rebuild the application