Program 1: Dialog Boxes for User Input
Learning Objectives for Program 1
After completion of Program 1, you should have demonstrated the use of
- Custom Modal Dialog Box to collect user input
- Custom Modeless Dialog Box to display the user input
- C# Class to store program data and pass it between objects
- Button click Event handlers to control the flow of the program
Assignment
Create a new C# project with four classes
- A
MainForm Windows Form as your primary window with two buttons:
- one to collect user information through the use of a modal dialog box
- one to display the user information through the use of a modeless dialog box
- A
UserInputForm to act as a modal dialog box to collect information entered by the user
- A
UserOutputForm to act as a modeless dialog box to display the user information previously entered
- A
Customer C# class to store (in memory) the user's firstName, middleInitial, lastName, streetAddress, city, state, zipCode, and phoneNumber.
Note: Dialog boxes should not include menu bars, window scroll bars, minimize and maximize buttons, status bars, sizable borders, or appear in the taskbar.
The user interface design for this project is done already. Base your implementation on the three screen captures below. Do not make up your own UI design - make your implementation match the physical design illustrated by the screen captures.
Note: this is a prototype. You do not need to error-check the user input or save the data to disk.
Submission Instructions
- The programming assignment is due in one week, at the start of Lab
- Test your program by entering your own name and address in the UserInput fields
- Print out three screen captures (use ALT-PrintScreen and paste into Word):
MainForm primary window
UserInputForm modal dialog box
UserOutputForm modeless dialog box
- Write your name, your cs446 account number, and your total completion time (rounded to the nearest hour) on your screen capture printout.
- The project will be checked online so be sure your solution is stored in your cs446 account in folder
U:\Programs\nnProgram1 where nn is your student account number
Grading Criteria
50 points maximum
The assignment will be scored using the following criteria:
- 30 points - Basic Functionality
- The
MainForm's two buttons are working (5)
- Get User Info instantiates and calls the UserInput form
- View User Info instantiates and calls the UserOutput form
- The
UserInputForm Dialog Box is complete and saves the user information correctly (10)
- Ok button saves the user data in a Customer instance object
- Cancel button does not save user information
- Up to three lines of Street Address text is permitted
- The
UserOutputForm Dialog Box is complete and displays the user input data correctly as shown (10)
- The contents of the user information is correct and complete
- The information is presented as specified on the sample screen snapshot
- The OK button causes the form to close
- A
Customer class used to represent a user data (5)
- use C# properties for each private instance variable
- 10 points - Form Properties
- The
UserInputForm is created as a modal dialog box (2)
- The
UserOutputForm is created as a modeless dialog box (2)
- The MainForm is a primary window with minimize, maximize, and close buttons (2)
- Both Dialog boxes are non-sizable, without minimize or maximize control buttons, and do not display in the taskbar (2)
- All Forms have appropriate title bar captions, are sized appropriately, with buttons centered on the form (2)
- 10 points - Placement and Layout of controls
- The controls are placed and arranged to promote usability - follow the example on the sample screen snapshot
- All text boxes are labeled
- All textboxes are sized appropriately for the expected input data
- All controls are aligned vertically and horizontally
- Follow the UI design specified in the screen snapshot, do not make up your own UI design on this assignment
URL: http://www/cwu.edu /~gellenbe/446/labs/program1.php
Author: Ed Gellenbeck, Department of Computer Science, Central Washington University, gellenbe@cwu.edu
Copyright 2006 Ed Gellenbeck, Central Washington University
Last modified: April 08, 2008