winforms Show Help using Help class


Example

You can use Help class in code, to provide these kinds of help:

  • Show a help pop-up for a control
  • Open a CHM file based on context (Show table of content, Show a keyword or index, show a topic)
  • Navigate to a URL using default browser

Show Help pop-up window

You can use Help.ShowPopup to display a help pop-up window:

private void control_MouseClick(object sender, MouseEventArgs e)
{
    var c = (Control)sender;
    var help = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, " +
               "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
    if (c != null)
        Help.ShowPopup(c, "Lorem ipsum dolor sit amet.", c.PointToScreen(e.Location));
}

It will show such help pop-up at your mouse pointer location:

enter image description here

Show CHM Help file

You can use different overloads of Help.ShowHelp method, to show a CHM file and navigate to a keyword, a topic, index or table of content:

Show Help Table of Content

Help.ShowHelp(this, "Help.chm"); 

Show Help for specific Keyword (index)

Help.ShowHelp(this, "Help.chm", HelpNavigator.Index, "SomeKeyword");

Show Help for specific Topic

Help.ShowHelp(this, "Help.chm", HelpNavigator.Topic, "/SomePath/SomePage.html");

Show Url

You can show any URL in default browser using ShowHelp method:

Help.ShowHelp(this, "Http://example.com");