MCC - CIS162AD
CS2 Department Contacts - 15 points
|
|
Create a project that will display the department, contact person's name and telephone number
for the customer relations, marketing, order processing, and shipping departments of a factitious company.
Sample Output:
Requirements:
- Use CS2 as the project name.
- Use CS2Form.cs as the form file name.
- Give each control object (labels, buttons) referenced in the program code a meaningful name as well as the form (CS2Form).
- Set the Text property of the form with the assignment number and your name (CS2 by Your Name).
- Feel free to experiment with the colors and fonts.
It is best to set the Font and ForeColor on the Form Object before adding control objects,
so they will become the default.
- Include a label at the top of the form with the title Phone Directory.
- Use labels on the left side of the form to identify the data being displayed.
These three labels do not need to be given meaningful names, but their Text property
should contain something like Department:, Contact:, and Phone:.
- Also use labels on the right side of the form to display the contact information.
Set the AutoSize property to False and the BorderStyle property to Fixed3D.
- Include a button for each department.
When the user clicks on the button for a department, the department name, contact name,
and telephone number for the contact person should be displayed in the three
separate labels on the right side of the form.
- Include a button for Exit.
- Define Access Keys for the buttons by entering an ampersand (&) in front to the letter that should be underlined
in the Text property.
- Define ToolTips (p740) for each of the Buttons.
Note: Only one ToolTip control needs to be added to the form. The ToolTip control
is displayed in the component tray, and the single control will activate
the ToolTip property for all of the buttons.
- Make sure the Tab Order (p284-285) is set to read like a book (left to right and top to bottom).
- Before beginning to write code:
- Make sure the requirements (problem) are understood.
- Sketch a form (see image above).
- List the name and property settings for each control object.
- Using pseudocode design the methods to handle the button-click event for each button.
- Build the project using the developed plan:
- Create the interface.
- Set the properties for the controls.
- Code the methods.
- Test the solution.
Special Note:
Sometimes the Access Keys on the buttons do not show up until the Alt key is pressed.
This setting can be changed on your computer.
For Windows XP try the following:
- Right-click on the desktop.
- Select Properties.
- Click on the Appearance tab.
- Click on the Effects button.
- Remove check in the box for "Hide underlined letters for keyboard navigation until I use the Alt key."
Test Data:
| Department |
Department Contact |
Telephone Number |
| Customer Relations |
Tricia Smith |
500-1111 |
| Marketing |
Michelle Tyler |
500-2222 |
| Order Processing |
Kenna Ross |
500-3333 |
| Shipping |
Eric Johnson |
500-4444 |
Sample Code:
private void btnCustomer_Click(object sender, EventArgs e)
{
lblDepartment.Text = "Customer Relations";
lblContact.Text = "Tricia Smith";
lblPhone.Text = "500-1111";
}
Submit: CS2Form.cs and CS2Form.Designer.cs
Revised: 8/11/2008 - www.mc.maricopa.edu/~marquez/cis162ad/cs2_dept_contacts.html