Helperprovider is a built-in control in the. NET Framework class library. It can provide pop-up or online help for controls. To associate a specific help string with a control, use the sethelpstring Method for pop-up. to associate a Help file with helpprovider, set the helpnamespace attribute to enable online help. At the same time, the helpnamespace online help and sethelpstring pop-up help are set. The helpnamespace help information is given priority.
Take a simple example:
I. Implementation pop-up help
1. Create a new window and set the basic attributes:
Helpbutton = true
Maximizebox = false
Minimizebox = false
This is not necessary, just to display the question mark in the upper right corner.
2. Compile the backgroundCode
Helpprovider HP;
Public Frm13helpprovider ()
{
Initializecomponent ();
// Instantiate helpprovider
HP = New Helpprovider ();
}
Private Void Frm13helpprovider_load ( Object Sender, eventargs E)
{
// Set the display information for the help of the control
HP. sethelpstring (button1, " This is a button " );
HP. sethelpstring (monthcalendar1, " This is a calendar Control " );
}
3. Press the F1 key during running, or click the question in the upper right corner to pop up the help information.
Ii. Online Help
1. Prepare online help documents, including CHM and HTML documents.
2. Compile the background code. The help file here is a web page creation manual, which must be prepared using tools in actual development.
// Set the pop-up help document by pressing F1
// It can be an HTML, CHM file, or a URL.
HP. helpnamespace = " Help. CHM " ;
Press the F1 key to view the online help.