Export (0) Print
Expand All

Help.ShowHelp Method

Displays the contents of a Help file.

Overload List

Displays the contents of the Help file at the specified URL.

[Visual Basic] Overloads Public Shared Sub ShowHelp(Control, String)
[C#] public static void ShowHelp(Control, string);
[C++] public: static void ShowHelp(Control*, String*);
[JScript] public static function ShowHelp(Control, String);

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

[Visual Basic] Overloads Public Shared Sub ShowHelp(Control, String, HelpNavigator)
[C#] public static void ShowHelp(Control, string, HelpNavigator);
[C++] public: static void ShowHelp(Control*, String*, HelpNavigator);
[JScript] public static function ShowHelp(Control, String, HelpNavigator);

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

[Visual Basic] Overloads Public Shared Sub ShowHelp(Control, String, String)
[C#] public static void ShowHelp(Control, string, string);
[C++] public: static void ShowHelp(Control*, String*, String*);
[JScript] public static function ShowHelp(Control, String, String);

Displays the contents of the Help file located at the URL supplied by the user.

[Visual Basic] Overloads Public Shared Sub ShowHelp(Control, String, HelpNavigator, Object)
[C#] public static void ShowHelp(Control, string, HelpNavigator, object);
[C++] public: static void ShowHelp(Control*, String*, HelpNavigator, Object*);
[JScript] public static function ShowHelp(Control, String, HelpNavigator, Object);

Example

[Visual Basic, C#, C++] The following 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 selected in the Help Navigator list. The Show Keyword button displays content in the Help file based on the keyword specified in the Keyword text box.

[Visual Basic, C#, C++] 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" (without the quotation marks) in the Parameter text box, and click the Show Help button. To show the "To paint with a brush" Help topic by the keyword, type "mspaint.chm::/paint_brush.htm" (without the quotation marks) in the Keyword text box and click the Show Keyword button.

[Visual Basic, C#, C++] This example only shows the call to ShowHelp. See the Help class overview for the complete code example.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of ShowHelp. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Private Sub showHelp_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles showHelp.Click
    ' Display Help using the Help navigator enumeration
    ' that is selected in the combo box. Some enumeration
    ' values make use of an extra parameter, which can
    ' be passed in through the Parameter text box.
    Dim navigator As HelpNavigator = HelpNavigator.TableOfContents
    If Not (navigatorCombo.SelectedItem Is Nothing) Then
        navigator = CType(navigatorCombo.SelectedItem, HelpNavigator)
    End If
    Help.ShowHelp(Me, helpfile, navigator, parameterTextBox.Text)
End Sub 'showHelp_Click

[C#] 
private void showHelp_Click(object sender, System.EventArgs e)
{
    // Display Help using the Help navigator enumeration
    // that is selected in the combo box. Some enumeration
    // values make use of an extra parameter, which can
    // be passed in through the Parameter text box.
    HelpNavigator navigator = HelpNavigator.TableOfContents;
    if (navigatorCombo.SelectedItem != null)
    {
        navigator = (HelpNavigator)navigatorCombo.SelectedItem;
    }
    Help.ShowHelp(this, helpfile, navigator, parameterTextBox.Text);
}

[C++] 
private:
   void showHelp_Click(Object* /*sender*/, System::EventArgs* /*e*/) {
      // Display Help using the Help navigator enumeration
      // that is selected in the combo box. Some enumeration
      // values make use of an extra parameter, which can
      // be passed in through the Parameter text box.
      HelpNavigator navigator = HelpNavigator::TableOfContents;
      if (navigatorCombo->SelectedItem != 0) {
         navigator = *__try_cast<__box HelpNavigator*>(navigatorCombo->SelectedItem);
      }
      Help::ShowHelp(this, helpfile, navigator, parameterTextBox->Text);
   }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

Help Class | Help Members | System.Windows.Forms Namespace

Show:
© 2014 Microsoft