Implementing Help in Application

For complex or difficult applications, you will want to provide built-in help. You can provide help in the form of HTML files that contain a set of linked help topics or as Compressed HTML (CHM) files that you create with Microsoft HTML Help Workshop. Both of these approaches allow you to display dynamically linked help topics that you can show to your users.

The Help Class

Your application can display HTM or CHM files to users by using the Help class. The Help class encapsulates the HTML Help 1.0 engine and provides static methods that allow you to display your help files. The two methods exposed by the Help class are ShowHelp and ShowHelpIndex.

The ShowHelp method is used to display a help file for a particular control. This method requires the control that is the parent of the HelpDialog box to be displayed as well as the URL of the help file. The URL specified can either be a file URL (C:\myHelp.htm) or an HTTP URL (HTTP://myHelp.htm). Because the ShowHelp method is Shared (static), you do not need to create an instance of the Help class to use it.

The HelpProvider Component

The HelpProvider component allows you provide help for the controls on your user interface. The HelpProvider is an extender provider; thus, it coordinates and maintains properties for each control as it is added to the form. You can specify a HelpString for each control on your form. This string is displayed when the control has the focus and F1 is pressed. You can also specify a HelpNameSpace that specifies the URL for the help file associated with the HelpProvider.

The HelpProvider component provides three properties to each control on the form:
  1. HelpString
  2. HelpKeyWord
  3. HelpNavigator
If the HelpNameSpace property is not set, the HelpString is automatically displayed, and the other two properties are ignored. If the HelpNameSpace property is set to a help file, however, it displays the help file specified using the parameters supplied by the HelpNavigator property and the HelpKeyword property. The HelpNavigator property can be set to any of the following values:
  1. TableOfContents. Displays the table of contents page.
  2. Find. Displays the search page.
  3. Index. Displays the index.
  4. Topic. Displays a help topic.
  5. AssociatedIndex. Displays the index for a specified topic.
  6. KeywordIndex. Displays a keyword-search-based result.
If the HelpNameSpace property is set, the HelpString is no longer displayed when F1 is pressed, although it can still be accessed in other ways. You can retrieve the HelpString associated with a particular control by calling the HelpProvider and then calling the HelpProvider.GetHelpString method.

RELATED POST

DAY 11 OOPS INTRODUCTION

DAY 12 POLYMORPHISM

DAY 13 INHERITANCE AND POLYMORPHISM

DAY 14 EBUGGING TOOLS IN DOT NET

DAY 15 DEBUG AND TRACE IN CLASSES

DAY 16 UNIT TEST PLAN

DAY 17 EXCEPTIONS IN VISUAL STUDIO

DAY 19 ADO.NET INTRODUCTION

DAY 20 DATA ACCESSING IN DOT NET

DAY 21 DATA BASE OBJECTS


No comments:

Post a Comment