HelpProvider.SetHelpNavigator(Control, HelpNavigator) Method

Definition

Specifies the Help command to use when retrieving Help from the Help file for the specified control.

public virtual void SetHelpNavigator (System.Windows.Forms.Control ctl, System.Windows.Forms.HelpNavigator navigator);

Parameters

ctl
Control

A Control for which to set the Help keyword.

navigator
HelpNavigator

One of the HelpNavigator values.

Exceptions

The value of navigator is not one of the HelpNavigator values.

Examples

The following code example demonstrates the use of the SetHelpNavigator method.

To run this example, place it in a form containing a HelpProvider named HelpProvider1 and a TextBox named TextBox1. The example requires the existence of a Help file named input.chm in the C:\Windows directory.


//Declare the HelpProvider.
internal System.Windows.Forms.HelpProvider HelpProvider1;

private void InitializeHelpProvider()
{
    // Construct the HelpProvider Object.
    this.HelpProvider1 = new System.Windows.Forms.HelpProvider();

    // Set the HelpNamespace property to the Help file for 
    // HelpProvider1.
    this.HelpProvider1.HelpNamespace = "c:\\windows\\input.chm";

    // Specify that the Help provider should open to the table
    // of contents of the Help file.
    this.HelpProvider1.SetHelpNavigator(TextBox1, 
        HelpNavigator.TableOfContents);
}

Applies to

Produit Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also