MCC - CIS162AD
CS2 Department Contacts - 10 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:
Special Note:
- 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 (frmCS2).
- 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 (p750) for each of the Buttons.
From the toolbox drag the ToolTip to the form and it will be placed in the component tray. After adding the ToolTip tool, a ToolTip property becomes available for each of the buttons. Only one ToolTip control needs to be added to the form. Go back to each of the buttons and set the newly added ToolTip property to display a message such as "Displays the contact information for the customer relations department".- Make sure the Tab Order (p288) is set to read like a book (left to right and top to bottom).
In the Professional Edition, click Tab Order listed under the View menu item.
- 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.
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:Test Data:
- 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."
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: 10/28/2011 - www.mesacc.edu/~marquez/cis162ad/cs2_dept_contacts.html