I am new to C# windows application.I would like to add custom help file using help provider from the toolbar in Microsoft visual studio 2010 for windows application.
I can add my help file and that is working fine. I'd like to context-sensitive help and that is working fine with Help.ShowHelp(). In the properties window we have a HelpNavigator property where it has options like .Topic, .TopicId, .AssociateIndex, .TableOfContents, .Index, .Find. I have chosen .TopicId but i am wondering where to specify my topic ID. I have two questions
- Is that possible ony by writing code in .cs file of the application?
- If yes,then what is the purpose of help navigator property?
Short story - no, you can achieve this (F1-Help) without writing code (but sometimes coding is a better solution).
The HelpNavigator property is an enumeration that specifies the Help command to use when retrieving Help from the Help file for the specified control (see also: Help for controls with VB .NET).
Connecting a CHM help file with your application and providing context-sensitive help for controls has a small learn curve.
Below are (code) examples that demonstrate using context-sensitive help by F1 and how to open the help viewer by TopicId.
F1 - Help
.HelpKeyword,.HelpNavigator,.HelpString,.ShowHelp. Set the full path to your CHM file to theHelpProvider.HelpNamespaceproperty.?button on the form's caption area, set the values of the following form propertiesHelpButton = True,MaximizeBox = False,MinimizeBox = False.?button was clicked by the user. For example, set the button1HelpKeywordproperty to 20010 and itsHelpNavigatorproperty to.TopicIdas shown in the screenshot below.... and the resulting help viewer window:
Open the Help Viewer
Following code is used to open a Help Viewer and a topic by TopicId 10000: