Application Online Help
Application Online Help
Providing Help
Introduction
When you have created an application, you should assist your users in figuring out how to use your application. You may think about training the users, which is good but may require your physical presence. Online Help is the ability to provide documents that can guide people about your application. Those file should be easily accessible to the users. One to make this possible to attach the files to your application.
There are various small but effective techniques you can use to provide help for your application.
Practical Learning: Introducing Help
Control | (Name) | Text | Other Properties | |
GroupBox | ![]() |
Loan Preparation | ||
Label | ![]() |
Principal | ||
TextBox | ![]() |
txtPrincipal | TextAlign: Right | |
Label | ![]() |
Interest Rate: | ||
TextBox | ![]() |
txtInterestRate | TextAlign: Right | |
Label | ![]() |
% | ||
Label | ![]() |
Number of Periods: | ||
TextBox | ![]() |
txtPeriods | TextAlign: Right | |
ComboBox | ![]() |
cbxPeriods | Items: Days Years Months |
|
GroupBox | ![]() |
Compound Frequency | ||
RadioButton | ![]() |
rdoDaily | Daily | |
RadioButton | ![]() |
rdoWeekly | Weekly | |
RadioButton | ![]() |
rdoMonthly | Monthly | |
RadioButton | ![]() |
rdoQuaterly | Quaterly | |
RadioButton | ![]() |
rdoSemiannualy | Semiannualy | |
RadioButton | ![]() |
rdoAnnualy | Annualy | |
Button | ![]() |
btnCalculate | Calculate | |
GroupBox | ![]() |
Loan Evaluation | ||
Label | ![]() |
Interest Earned: | ||
TextBox | ![]() |
txtInterestEarned | TextAlign: Right | |
Label | ![]() |
Future Value: | ||
TextBox | ![]() |
txtFutureValue | TextAlign: Right | |
Button | ![]() |
btnClose | Close |
Status Bar Messages
One way you can provide simple help consists of displaying short indicative messages on a status bar. To do this, you can first create sections, called panels, on a status bar and then display the necessary messages in the section of your choice. The message can be anything but it should consist of just a few words to fit in its section without going over board.
Practical Learning: Helping Through a Status Bar
namespace BusinessAccounting30 { public partial class CompoundedInterest : Form { public CompoundedInterest() { InitializeComponent(); } private void CompoundedInterest_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "Ready."; } private void txtPrincipal_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "Amount financed or loan amount borrowed."; } private void txtInterestRate_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "The factor by which the principal grows over a period."; } private void txtPeriods_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "The length of the loan in term of months, years, etc."; } private void cbxPeriods_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "The types of the number of periods."; } private void rdoDaily_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "Applied when accrued interest is evaluated daily."; } private void rdoWeekly_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "Interest earned calculated on a weekly basis."; } private void rdoMonthly_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "The interest earned is evaluated every month."; } private void rdoQuarterly_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "Calculation of the accrued interest once in three months."; } private void rdoSemiannually_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "The accrued interest is evaluated once in six months."; } private void rdoAnnually_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "Once in a year, the accrued or earned interest is evaluated."; } private void btnCalculate_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "When values are ready, click this buttong to evaluate the loan."; } private void btnCalculate_Click(object sender, EventArgs e) { /* A compound type specifies the frequency by which * the interest is evaluated. The options are that * the evaluation be made hourly, daily, weekly, biweekly, * semi-monthly, monthly, quaterly, semi-annually, or annually. */ double compoundType; // The principal is the amount invested in getting a loan or the amount of money borrowed. double principal = 0d; // The interest rate is the fraction that influence the amount owned by the lender double iRate = 0d; // The period is the number of units by which the interest accrued is evaluated double per = 0d; if (string.IsNullOrEmpty(txtPrincipal.Text)) { MessageBox.Show("You must provide a valid number for the principal.", "Business Accounting", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (string.IsNullOrEmpty(txtInterestRate.Text)) { MessageBox.Show("Please type a valid decimal number for the interest rate.", "Business Accounting", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (string.IsNullOrEmpty(txtPeriods.Text)) { MessageBox.Show("You are supposed to type a valid number for " + "the number of days, weeks, months, quarters, or years.", "Business Accounting", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } try { // Retrieve the value of the principal principal = double.Parse(txtPrincipal.Text); } catch (FormatException fe) { MessageBox.Show("There is a problem with the value you provided " + "for the principal." + Environment.NewLine + "Please report the error as: " + fe.Message, "Business Accounting", MessageBoxButtons.OK, MessageBoxIcon.Information); } try { // Retrieve the interest rate iRate = double.Parse(txtInterestRate.Text); } catch (FormatException fe) { MessageBox.Show("You must provide a valid fractional number for the interest rate." + Environment.NewLine + "You can present the error as: " + fe.Message, "Business Accounting", MessageBoxButtons.OK, MessageBoxIcon.Information); } try { // Get the number of periods per = double.Parse(txtPeriods.Text); } catch (FormatException fe) { MessageBox.Show("Please type the number of days, weeks, months, quarters, or years." + Environment.NewLine + "The error resulting is: " + fe.Message, "Business Accounting", MessageBoxButtons.OK, MessageBoxIcon.Information); } // Find out what radio button was clicked to apply the compound frequency if (rdoDaily.Checked == true) compoundType = 360d; else if (rdoWeekly.Checked == true) compoundType = 52d; else if (rdoMonthly.Checked) compoundType = 12d; else if (rdoQuarterly.Checked) compoundType = 4d; else if (rdoSemiannually.Checked) compoundType = 2d; else { compoundType = 1d; rdoAnnually.Checked = true; } double periods; if (cbxPeriods.Text == "Days") periods = per / 360d; else if (cbxPeriods.Text == "Months") periods = per / 12d; else { periods = per; cbxPeriods.Text = "Years"; } // These values will make the calculation easier to read double interestRate = iRate / 100d; double i = interestRate / compoundType; double n = compoundType * periods; // Perform the necessary calculations // double ratePerPeriod = interestRate / periods; double futureValue = principal * Math.Pow(1 + i, n); double interestEarned = futureValue - principal; // Display the values in the appropriate text boxes txtInterestEarned.Text = interestEarned.ToString("C"); txtFutureValue.Text = futureValue.ToString("C"); } private void txtInterestEarned_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "The amount acculumated as interest."; } private void txtFutureValue_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "The total amount paied or accumulated at the end of the loan."; } private void btnClose_MouseMove(object sender, MouseEventArgs e) { ssStatusBar.Items[0].Text = "To end the application, click this button."; } private void btnClose_Click(object sender, EventArgs e) { Close(); } } }
![]() |
![]() |
![]() |
![]() |
Control | (Name) | Text | Other Properties | |
Panel | ![]() |
pnlCategories | ||
Label | ![]() |
Select the Category of Known Values | Font: Times New Roman, 9.75pt, style=Bold | |
RadioButton | ![]() |
rdoAAS | AAS - Known Values: Two angles and a side opposite one of them | |
RadioButton | ![]() |
rdoASA | ASA - Known Values: Two angles and the side between them | |
RadioButton | ![]() |
rdoSAS | SAS - Known Values: Two sides and the angle between them | |
RadioButton | ![]() |
rdoSSS | SSS - Known Values: All three sides | |
Panel | ![]() |
pnlAAS | ||
PictureBox | ![]() |
pbxAAS | SizeMode: AutoSize | |
Label | ![]() |
BackColor: Blue AutoSize: False |
||
Label | ![]() |
Known Values | Font: Times New Roman, 12pt, style=Bold | |
Label | ![]() |
______________________ | ||
Label | ![]() |
Angle 1: | ||
TextBox | ![]() |
txtAASAngle1 | TextAlign: Right | |
Label | ![]() |
Angle 2: | ||
TextBox | ![]() |
txtAASAngle2 | TextAlign: Right | |
Label | ![]() |
Side 1 | ||
TextBox | ![]() |
txtAASSide1 | TextAlign: Right | |
Button | ![]() |
btnAASCalculate | Calculate | |
Label | ![]() |
Unknown Values | Font: Times New Roman, 12pt, style=Bold | |
Label | ![]() |
______________________ | ||
Label | ![]() |
Angle 3: | ||
TextBox | ![]() |
txtAASAngle3 | TextAlign: Right | |
Label | ![]() |
Side 2: | ||
TextBox | ![]() |
txtAASSide2 | TextAlign: Right | |
Label | ![]() |
Side 3 | ||
TextBox | ![]() |
txtAASSide3 | TextAlign: Right | |
Panel | ![]() |
pnlASA | ||
PictureBox | ![]() |
pbxASA | Image: asa SizeMode: AutoSize |
|
Label | ![]() |
Known Values | Font: Times New Roman, 12pt, style=Bold | |
Label | ![]() |
Angle 1: | ||
TextBox | ![]() |
txtASAAngle1 | TextAlign: Right | |
Label | ![]() |
Angle 2: | ||
TextBox | ![]() |
txtASAAngle2 | TextAlign: Right | |
Label | ![]() |
Side 1: | ||
TextBox | ![]() |
txtASASide1 | TextAlign: Right | |
Button | ![]() |
btnASACalculate | Calculate | |
Label | ![]() |
Unknown Values | Font: Times New Roman, 12pt, style=Bold | |
Label | ![]() |
Angle 3: | ||
TextBox | ![]() |
txtASAAngle3 | TextAlign: Right | |
Label | ![]() |
Side 2: | ||
TextBox | ![]() |
txtASASide2 | TextAlign: Right | |
Label | ![]() |
Side 3: | ||
TextBox | ![]() |
txtASASide3 | TextAlign: Right | |
Button | ![]() |
btnClose | Close | |
Panel | ![]() |
pnlSAS | ||
PictureBox | ![]() |
pbxSAS | Image: sas SizeMode: AutoSize |
|
Label | ![]() |
Known Values | Font: Times New Roman, 12pt, style=Bold | |
Label | ![]() |
Side 1: | ||
TextBox | ![]() |
txtSASSide1 | TextAlign: Right | |
Label | ![]() |
Angle 1: | ||
TextBox | ![]() |
txtSASAngle1 | TextAlign: Right | |
Label | ![]() |
Side 2: | ||
TextBox | ![]() |
txtSASSide2 | TextAlign: Right | |
Button | ![]() |
btnSASCalculate | Calculate | |
Label | ![]() |
Unknown Values | Font: Times New Roman, 12pt, style=Bold | |
Label | ![]() |
Side 3: | ||
TextBox | ![]() |
txtSASSide3 | TextAlign: Right | |
Label | ![]() |
Angle 2: | ||
TextBox | ![]() |
txtSASAngle2 | TextAlign: Right | |
Label | ![]() |
Angle 3: | ||
TextBox | ![]() |
txtSASAngle3 | TextAlign: Right | |
Panel | ![]() |
pnlSSS | ||
PictureBox | ![]() |
pbxSSS | Image: sss SizeMode: AutoSize |
|
Label | ![]() |
Known Values | Font: Times New Roman, 12pt, style=Bold | |
Label | ![]() |
Side 1: | ||
TextBox | ![]() |
txtSSSSide1 | TextAlign: Right | |
Label | ![]() |
Side 2: | ||
TextBox | ![]() |
txtSSSSide2 | TextAlign: Right | |
Label | ![]() |
Side 3: | ||
TextBox | ![]() |
txtSSSSide3 | TextAlign: Right | |
Button | ![]() |
btnSSSCalculate | Calculate | |
Label | ![]() |
Unknown Values | Font: Times New Roman, 12pt, style=Bold | |
Label | ![]() |
Angle 1: | ||
TextBox | ![]() |
txtSSSAngle1 | TextAlign: Right | |
Label | ![]() |
Angle 2: | ||
TextBox | ![]() |
txtSSSAngle2 | TextAlign: Right | |
Label | ![]() |
Angle 3: | ||
TextBox | ![]() |
txtSSSAngle3 | TextAlign: Right |
namespace ObliqueTriangles2 { public partial class ObliqueTriangles : Form { public ObliqueTriangles() { InitializeComponent(); } private void ObliqueTriangles_Load(object sender, EventArgs e) { pnlSSS.Location = pnlSAS.Location = pnlASA.Location = pnlAAS.Location; rdoAAS.Checked = true; rdoAAS_CheckedChanged(sender, e); } private void rdoAAS_CheckedChanged(object sender, EventArgs e) { pnlAAS.BringToFront(); } private void rdoASA_CheckedChanged(object sender, EventArgs e) { pnlASA.BringToFront(); } private void rdoSAS_CheckedChanged(object sender, EventArgs e) { pnlSAS.BringToFront(); } private void rdoSSS_CheckedChanged(object sender, EventArgs e) { pnlSSS.BringToFront(); } private void btnAASCalculate_Click(object sender, EventArgs e) { double angle1 = 0.00, angle2 = 0.00, side1 = 0.00; try { angle1 = double.Parse(txtAASAngle1.Text); } catch (FormatException) { MessageBox.Show("You must type a value for the lower left angle of the AAS shape.", "Obliques Triangles"); } try { angle2 = double.Parse(txtAASAngle2.Text); } catch (FormatException) { MessageBox.Show("You must type a value for the lower right angle of the AAS shape.", "Obliques Triangles"); } try { side1 = double.Parse(txtAASSide1.Text); } catch (FormatException) { MessageBox.Show("You must type a value for the right side of the AAS shape.", "Obliques Triangles"); } // Here, we use the law of sines double angle3 = 180 - (angle1 + angle2); double side2 = side1 * Math.Sin(angle2 * Math.PI / 180) / Math.Sin(angle1 * Math.PI / 180); double side3 = side1 * Math.Sin(angle3 * Math.PI / 180) / Math.Sin(angle1 * Math.PI / 180); txtAASAngle3.Text = angle3.ToString(); txtAASSide2.Text = side2.ToString(); txtAASSide3.Text = side3.ToString(); } private void btnASACalculate_Click(object sender, EventArgs e) { double angle1 = 0.00, side1 = 0.00, angle2 = 0.00; try { angle1 = double.Parse(txtASAAngle1.Text); } catch (FormatException) { MessageBox.Show("You must type a value for the lower left angle of the ASA shape.", "Obliques Triangles"); } try { side1 = double.Parse(txtASASide1.Text); } catch (FormatException) { MessageBox.Show("You must type a value for the bottom side of the AAS shape.", "Obliques Triangles"); } try { angle2 = double.Parse(txtASAAngle2.Text); } catch (FormatException) { MessageBox.Show("You must type a value for the lower right angle of the ASA shape.", "Obliques Triangles"); } double angle3 = 180 - (angle1 + angle2); double side2 = side1 * Math.Sin(angle2 * Math.PI / 180) / Math.Sin(angle1 * Math.PI / 180); double side3 = side1 * Math.Sin(angle3 * Math.PI / 180) / Math.Sin(angle1 * Math.PI / 180); txtASAAngle3.Text = angle3.ToString(); txtASASide2.Text = side3.ToString(); txtASASide3.Text = side2.ToString(); } private void btnSASCalculate_Click(object sender, EventArgs e) { double side1 = 0.00, angle1 = 0.00, side2 = 0.00; try { side1 = double.Parse(txtSASSide1.Text); } catch (FormatException) { MessageBox.Show("You must type a value for the left side of the SAS shape.", "Obliques Triangles"); } try { angle1 = double.Parse(txtSASAngle1.Text); } catch (FormatException) { MessageBox.Show("You must type a value for the top angle of the SAS shape.", "Obliques Triangles"); } try { side2 = double.Parse(txtSASSide2.Text); } catch (FormatException) { MessageBox.Show("You must type a value for the right side of the SAS shape.", "Obliques Triangles"); } // Here, we use the law of cosines double side3 = Math.Sqrt((side1 * side1) + (side2 * side2) - (2 * side1 * side2 * Math.Cos(angle1 * Math.PI / 180))); double angle2 = Math.Acos(((side3 * side3) + (side2 * side2) - (side1 * side1) ) / (2 * side3 * side2)) * 180 / Math.PI; double angle3 = 180 - (angle1 + angle2); txtSASSide3.Text = side3.ToString(); txtSASAngle2.Text = angle2.ToString(); txtSASAngle3.Text = angle3.ToString(); } private void btnSSSCalculate_Click(object sender, EventArgs e) { double side1 = 0.00, side2 = 0.00, side3 = 0.00; try { side1 = double.Parse(txtSSSSide1.Text); } catch (FormatException) { MessageBox.Show("You must type a value for the left side of the SSS shape.", "Obliques Triangles"); } try { side2 = double.Parse(txtSSSSide2.Text); } catch (FormatException) { MessageBox.Show("You must type a value for the right side of the SSS shape.", "Obliques Triangles"); } try { side3 = double.Parse(txtSSSSide3.Text); } catch (FormatException) { MessageBox.Show("You must type a value for the bottom side of the SSS shape.", "Obliques Triangles"); } // Here, we use the law of cosines double angle1 = Math.Acos(((side3 * side3) + (side2 * side2) - (side1 * side1) ) / (2 * side3 * side2)) * 180 / Math.PI; double angle2 = Math.Acos(((side3 * side3) + (side1 * side1) - (side2 * side2) ) / (2 * side3 * side1)) * 180 / Math.PI; double angle3 = 180 - (angle1 + angle2); txtSSSAngle1.Text = angle1.ToString(); txtSSSAngle2.Text = angle2.ToString(); txtSSSAngle3.Text = angle3.ToString(); } private void btnClose_Click(object sender, EventArgs e) { Close(); } } }
Tool Tips
A tool tip is a small yellow box that displays a word or a group of words when the user positions the mouse on top of a control:
To create a tool tip system in a Windows Forms application, first add a ToolTip control to a form. After adding a ToolTip control, the form and all controls on it receive a new field in the Properties window. If the new ToolTip control is called ToolTip1, the new field in the Properties window for each control is ToolTip on ToolTip1. To display a tool tip for a control, first click it on the form. Then, in the Properties window, click ToolTip on ToolTip1, and type the desired tool tip.
Practical Learning: Adding Tool Tips
Control | ToolTip On ttObliqueTriangles |
rdoAAS | Selection to make if the value of one side, the angle oppsosite to that side, and another angle are known. The law of Sines is used to calculate the unknown values. |
rdoASA | In this option, two angles are known. Also, the side between those angles is known. Use the law of Sines to find the unknown angle and the other two unknown sides. |
rdoSAS | With SAS, the values of two sides and the angle between them are known. Use the law of Cosines to calculate the unknown side and the values of the other two angles. |
rdoSSS | Knowing the values of all three sides of a triangle (SSS), use the law of Cosines to calculate the unknown values of the angles. |
txtAASAngle1 | Value for one of the known angles |
txtAASAngle2 | Value for one of the known angles |
txtAASSide1 | Value for the known side |
btnAASCalculate | Make sure you first provide the values for the known angles and the known side. |
txtAASAngle3 | Calculated value for the unknown angle |
txtAASSide2 | Calculated value for one of the unknown sides |
txtAASSide3 | Calculated value for one of the unknown sides |
txtASAAngle1 | In this ASA situation, type the value of one of the known angles. |
txtASASide1 | In this ASA situation, type the value for the known side. |
txtASAAngle2 | Type the value of the other known angle. |
btnASACalculate | Make sure you provide the values for the known angles and the known side. |
txtASAAngle3 | Calculated value for the unknown angle. |
txtASASide2 | Calculated value for one of the unknown sides. |
txtASASide3 | Calculated value for one of the unknown sides. |
txtSASSide1 | Knowing the angle included in two known sides, type the value of one of the available sides. |
txtSASAngle1 | Type the known value of the angle between two known sides. |
txtSASSide2 | Enter the value of the second known sides. |
btnSASCalculate | Make sure you first provide the values for the known sides and the known angle. |
txtSASSide3 | Calculated value for the unknown side |
txtSASAngle2 | Calculated value for one of the unknown angles. |
txtSASAngle3 | Calculated value for one of the unknown angles. |
txtSSSSide1 | All three sides are known. Type the value of one of them. |
txtSSSSide2 | The values of all three sides must be available. Type one of them. |
txtSSSSide3 | Enter the third known side |
btnSSSCalculate | Make sure you first provide the values for the known sides |
txtSSSAngle1 | Calculated value for one of the angles. |
txtSSSAngle2 | Calculated value for one of the angles. |
txtSSSAngle3 | Calculated value for one of the angles. |
btnClose | Click here to close the form |
Online Help
Introduction
Online help is the system of providing help files with an application. Online help is usually available from the main menu through a menu group created under a Help category.
In the past, the techniques to provide or program online help were not always easy. The early implementations of help were created in a system called WinHelp. This required using a Rich Text Format (rtf) file and appropriately formatting it. It is possible that, when folks at Microsoft developed WinHelp, they had only Microsoft Word in mind. It was difficult to get the required file ready if you were using another application such as WordPad or WordPerfect... Creating the help file was not enough. Once the file was ready, it had to be added to the application, and appropriately. This back and forth gymnastic was a great motivation for neglect. As if these difficulties were not enough, or because of these difficulties, Microsoft created another system called HTML Help. This neither solved most problems nor created an easier solution. At this time, this HTML Help is widely used and many companies, such as AutoDesk (AutoCAD) and Macromedia to name just two, have adopted it . Many companies such as Borland, Jasc, just to name two, are still using WinHelp. This indicates that HTML Help didn't solve all problems and was not anonymously adopted.
Because HTML Help is the most supported help system by Microsoft, we will use it. Also, it is easier to use HTML Help in a Microsoft Visual Studio 2010 application than to use WinHelp.
The Help Provider
Context-sensitive help allows the user to get local help on a particular control. This works by the user who can first click a control and then press Shift+F1. This displays a yellow box with a word or a group of words:
This help is easier to provide in a dialog box because a dialog has a feature not available on a form. It consists of adding a button with a question mark and then creating the words that would display eventually. When you create this type of dialog box, the user can click the question marked button and click a control. The user can also press Shift+F1. This causes the mouse pointer to be equipped with a question mark. The user can then click a control and a yellow box would appear for that control, providing help.
To make it easy to provide online help in a Visual Studio 2010application, the .NET Framework provides the HelpProvider control. After adding this control to the application, the form and all controls on it receive a new property labeled HelpString On HelpProvider1. You can then type the desired string in the field of the Properties window for each control that would display context-sensitive help.
Practical Learning: Using Context-Sensitive Help
Control | HelpString On HelpProvider1 |
txtOrderTotal | This is the total amount of the current order |
txtAmountTended | This is the amount the customer tended |
btnCalculate | Click here to calculate the difference between the amount tended and the total price of the order |
txtDifference | This displays the difference between the amount tended and the total of the order |
btnClose | Click here to close the dialog box |
![]() |
![]() |
private void exitToolStripMenuItem_Click(object sender, EventArgs e) { Close(); }
Introduction to HTML Help
The online help we described above provides only small yellow boxes. It is called context-sensitive help because it provides its assistance on only a control of the form. Another technique, in fact highly supported with any commercial program, consists of providing an external application that resembles a book. This allows the user to get more detailed information about almost any aspect of the application.
To provide online help in a Microsoft Visual Studio application, you can use an external system. This consists of creating a complete application whose only purpose is to describe another application. This means that, in the beginning, both applications are not related in any way. This is the job of the HTML Help application. With HTML Help, you must first create HTML files. You create these files anyway you like but, in this case, they are meant to provide support for a specific application. Therefore, when creating the files, try to divide them by issues. For example, you can create a file for each form of your application and use that file to describe what the form or dialog box is used for. You still can use any approach to create the files you would need. Experience will guide you eventually into knowing what to put in those files.
After creating the HTML files, you can open HTML Help Workshop which is a complete but separate application.
Practical Learning: Creating an HTML Help File
![]() |
![]() |
![]() |
![]() |
body { font-size: 10pt; color: black; margin-top: 0pt; margin-left: 0pt; font-family: Verdana, Tahoma, Arial, Sans-Serif; } .maintitle { font-weight: bold; font-size: 24pt; color: blue; font-family: Garamond, Georgia, 'Times New Roman' , Serif; }
<html> <head> <link rel="stylesheet" type="text/css" href="cic.css"> <title>Overview of Clarksville Ice Cream</title> </head> <body> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="100%" align="center"> <p class="maintitle">Overview of Clarksville Ice Cream</p></td> </tr> <tr> <td width="100%" bgcolor="#0000FF" height="2"></td> </tr> </table> <p> </p> <center><img border="0" src="images/order.gif" alt="The main window of the application" width="416" height="284"></center> <p>Clarksville Ice Cream is a computer application used to process customers orders. It allows an employee to receive requests from a customer, based on what is available in the menu. When the order is complete, an ice cream is "prepared" and handed to the customer. As a commercial business, the application calculates the total amount. The amount is read to the customer who hands money to the clerk to complete the transaction</p> </body> </html>
<html> <head> <link rel="stylesheet" type="text/css" href="cic.css"> <title>Customer Order Form</title> </head> <body> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="100%" align="center"> <p class="maintitle">Customer Order Form</p> </td> </tr> <tr> <td width="100%" bgcolor="#0000FF" height="2"></td> </tr> </table> <p> </p> <p>The main or opening window of this application displays a form used to process customers orders. The top section of the form, also called the title bar, is equipped with a menu called the main menu. this menu allows the user to start a new order or to close the application. To use this main menu, you can click one of the top-level words such as File. This causes the menu category of your choice to expand:</p> <center> <img border="0" src="images/mainmenu.gif" alt="The main menu" width="416" height="284"></center> <p>After using a menu item, you can click it or click somewhere else to collapse it.</p> <p>The other objects on the main form allow the user to process an order by selecting items from the Windows controls. Once an order is ready, the user can click the Calculate Total button. This evaluates the total price of the order and displays it in the text box on the right side of Order Total.</p> <p>To start a new customer order, the user can click the New Order button. This resets all controls on the form:</p> <center> <img border="0" src="images/empty.gif" alt="Customer Form Reset" width="416" height="284"></center> <p>When an order has been calculated, the user can click the Calculate Difference button to evaluate the difference.</p> </body> </html>
<html> <head> <link rel="stylesheet" type="text/css" href="cic.css"> <title>Difference Calculation</title> </head> <body> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="100%" align="center"> <p class="maintitle">Difference Calculation</p> </td> </tr> <tr> <td width="100%" bgcolor="#0000FF" height="2"></td> </tr> </table> <p> </p> <p>The Calculation dialog box allows a user to easily calculate the amount of money owed to a customer. After a customer has placed an order and given money to the clerk, the user can display this dialog box. When it comes up, the top text box of this window already displays the amount of the customer's order. The user can then simply enter the amount the customer gave in the Amount Tended text box. Then the user can click Calculate</p> <center> <img border="0" src="images/calculation.gif" width="304" height="152"></center> <p>When the user has clicked the Calculate button, it calculates the difference and displays it in the Difference text box. After using this dialog box, the user can close it by clicking Close.</p> <p> </p> </body> </html>
<html> <head> <title>Clarksville Ice Cream - Home</title></head> <body> <h1>Clarksville Ice Cream</h1> <p><a href="introduction.htm">Introduction</a></p> <p><a href="mainform.htm">The Main Form</a></p> <p><a href="calculation.htm">The Difference Calculation Dialog Box</a></p> </body> </html>
New Page Title | Page or URL |
Customer Order Form | Customer Order Form |
Difference Calculation | Difference Calculation |
New Keyword | Page or URL |
amount | Difference Calculation |
money | Difference Calculation |
customer | Difference Calculation |
order | Difference Calculation |
clerk | Difference Calculation |
window | Difference Calculation |
Amount Tended | Difference Calculation |
Calculate | Difference Calculation |
Close | Difference Calculation |
computer | Overview of Clarksville Ice Cream |
Application | Overview of Clarksville Ice Cream |
employee | Overview of Clarksville Ice Cream |
menu | Overview of Clarksville Ice Cream |
commercial | Overview of Clarksville Ice Cream |
business | Overview of Clarksville Ice Cream |
transaction | Overview of Clarksville Ice Cream |
Main Menu | Customer Order Form |
category | Customer Order Form |
choice | Customer Order Form |
HTML Help and Windows Applications
After creating the HTML Help application, you can use an HelpProvider control to connect it to your application. The HelpProvider control is equipped with the HelpNamespace provider. This property allows you to specify the application that contains the help application. Besides the HelpNamespace property, the HelpProvider control provides various methods to manage help.
HTML Help can be provided to a Microsoft Visual Studio application through the Help class. The overloaded ShowHelp() method is used to specify the help file to display and possibly additional information. Notice that all versions take a first argument as a Control type. This is the parent control from where the online help will be provided.
The first version of the ShowHelp() method allows you to specify the help file. It can be the help file specified in the HelpProvider.HelpNamespace property mentioned above.
The second and the fourth versions of the ShowHelp() method allow you to specify the tab of the HTML Help window to display when the method is called. This is done through the HelpNavigator enumerator that has a value for each tab of the HTML Help window. the fourth version can be used to open the HTML Help window from its Find tab and specify a keyword to search for.
The third version of the ShowHelp() method can be used to open a help file based on a keyword.
The ShowHelpIndex() method can be used to open the Index tab of the HTML Help window.
Practical Learning: Providing Online Help to an Application
private void contentsToolStripMenuItem_Click(object sender, EventArgs e)
{
Help.ShowHelp(this, hpvIceCream.HelpNamespace);
}
private void indexToolStripMenuItem_Click(object sender, EventArgs e)
{
Help.ShowHelpIndex(this, hpvIceCream.HelpNamespace);
}
private void searchToolStripMenuItem_Click(object sender, EventArgs e)
{
Help.ShowHelp(this, hpvIceCream.HelpNamespace, HelpNavigator.Find, "");
}
|
|||
Previous | Copyright © 2004-2023, FunctionX, Inc. | Monday 08 May 2023 | Next |
|