0 out of 1 rated this helpful - Rate this topic

HelpProvider.SetHelpNavigator Method

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

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public virtual void SetHelpNavigator (
	Control ctl,
	HelpNavigator navigator
)
public void SetHelpNavigator (
	Control ctl, 
	HelpNavigator navigator
)
public function SetHelpNavigator (
	ctl : Control, 
	navigator : HelpNavigator
)
Not applicable.

Parameters

ctl

A Control for which to set the Help keyword.

navigator

One of the HelpNavigator values.

Exception typeCondition

InvalidEnumArgumentException

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

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);
}

//Declare the HelpProvider.
private 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.set_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);
} //InitializeHelpProvider

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.