| Printable Version
Adding Help To Applications
By Tran Khanh Hien
With Help class, our applications can display either HTMLHelp or Win32
Help.
Help class has 3 main static methods : ShowHelp(), ShowHelpIndex() and
ShowPopup(). In this article, I will show how to use these methods.
1. ShowHelp method
: displays the content of a Help file.
|
public static void
ShowHelp(Control parent, string url);
public static void
ShowHelp(Control parent, string url, string topic);
Parameters :
- parent : a control that identifies the parent of the Help
dialog
- url : the path to the HTMLHelp or Win32 Help file
- topic : the topic to display. This value references the
page to display (HTMLHelp file) or the numeric value of the
topic's ID (Win32 Help file). |
Example :
- Display the content of 'TestHelp.chm' file
Help.ShowHelp(this,"TestHelp.chm");
- Display 'Topic1' of 'TestHelp.chm'
file
Help.ShowHelp(this,"TestHelp.chm","topic1.htm");
2. ShowHelpIndex
method : displays the index of a Help file.
|
public static void
ShowHelpIndex(Control parent, string url);
Parameters :
- parent : a control that identifies the parent of the Help
dialog
- url : the path to the HTMLHelp or Win32 Help file |
Example :
Display the index of 'TestHelp.chm' Help
file
Help.ShowHelpIndex(this,"TestHelp.chm");
3. ShowPopup method
: displays a Help pop-up window.
|
public static void
ShowPopup(Control parent, string caption, Point location);
Parameters :
- parent : a control that identifies the parent of the Help
dialog
- caption : the string to display in the pop-up window
- location : the location to display the pop-up window |
Example :
Display the pop-up window at index of
'TestHelp.chm' Help file
Help.ShowPopup(this,"This is a Help pop-up",new
Point(100,100));
Source
Code: TestHelp.zip
|