Help.ShowHelp Method (Control, String, String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Displays the contents of the Help file found at the specified URL for a specific keyword.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public static void ShowHelp(
	Control parent,
	string url,
	string keyword
)

Parameters

parent
Type: System.Windows.Forms.Control

A Control that identifies the parent of the Help dialog box.

url
Type: System.String

The path and name of the Help file.

keyword
Type: System.String

The keyword to display Help for.

The url parameter can be of the form C:\path\sample.chm or /folder/file.htm.

If you provide the keyword null, the table of contents for the Help file will be displayed.

The following code example displays a form with three buttons that can be used to interact with the mspaint.chm Help file. The Show Help Index button displays the Index tab for the Help file. The Show Help button displays content in the Help file based on the value that is selected in the Help Navigator list. The Show Keyword button displays content in the Help file based on the keyword that is specified in the Keyword text box.

For example, to show the Ovals Help page by the index value, select the HelpNavigator.KeywordIndex value in the Help Navigator drop-down list, type ovals in the Parameter text box, and then click the Show Help button. To show the "To paint with a brush" Help topic by the keyword, type mspaint.chm::/paint_brush.htm in the Keyword text box, and then click the Show Keyword button.

This example shows only the call to the ShowHelp method. See the Help class overview for the complete code example.

private void showKeyword_Click(object sender, System.EventArgs e)
{
    // Display help using the provided keyword.
    Help.ShowHelp(this, helpfile, keyword.Text);
}

WebPermission

for accessing an HTML Help file through an HTTP request. Associated enumeration: NetworkAccess.Connect

SecurityPermission

for accessing an HTML Help file not served from an HTTP server. Associated enumeration: UnmanagedCode

.NET Framework
Available since 1.1
Return to top
Show: