|
Lars P. Linden MIS Dept. University of Central Florida |
Lab 03
More Controls
About This Lab
Some interfaces need a variety of controls. A Request-a-Router Application is one of them.
Here is the situation. The organization has several departments and each department manager gets to make requests for IT equipment. The equipment is then ordered by a Purchase Manager at HQ.
Build a "Router Request" application that will allow a manager to specify a router purchase request.
Here are the requirements.
Router Request Requirements
-
TextBox for a number
This control will allow the user to enter a quantity of routers. Place a label that reads "Quantity" next to the control so that the user knows the purpose of the control.
-
RadioButtons for an either/or selection
Start with a GroupBox that reads: "Router Type".
Inside the GroupBox place two RadioButton controls. This will allow the user to select either a "Static" router or a "Dynamic" router.
-
ComboBox for a limited set of selections
Add two ComboBox controls and accompanying labels.
Initialize each ComboBox when the form loads.
One ComboBox is for the user to specify how many WAN ports. Due to corporate policy the possibilities are 1, 2, or 4.
The other ComboBox is for the user to specify how many LAN ports. The possibilities are 1, 2, 4, or 16.
-
DateTimePicker for a calendar date
So that Purchase Manager at HQ, who orders the router, can plan for shipping, add a DateTimePicker control for the user to specify a "NeedBy" date. The user is specifying that they need to have the router delivered by this date.
-
NumericUpDown for the required number of quality "stars"
The routers are generally rated by "stars" which indicate their quality rating.
Set up the control so that the user is able to enter only whole numbers from 0 to 5.
-
TextBox for the requester's ID
The Purchase Manager at HQ needs to know who filled out the form, so add a TextBox for the user to add an ID.
-
Button for generating the request report
Add a Button control.
This button should be disabled when the form loads. So, add code to the Form's Load event handler that initializes the button as being disabled.
To allow the user to click on the button, assign the value of True to the button in the TextChanged event handler associated with the ID TextBox.
When the user clicks on the button all of the data specified by the controls should be displayed in a matching label next to it.
Your interface should look (more or less) like the one below. The green arrows point to indicated the flow of data, from control to label.

-
Testing Phase
Build and execute your application.
Select values using each control, and click the button. If all of the values displayed in the report labels match, then you have completed the requirements. If the values do not match, inspect your code and try to fix the problem.
-
Add
Make the ComboBoxes display the information dynamically.
Double-click on the ComboBox and add code that will display the user's selection on the associated label right after the user makes the selection. Hint: SelectedIndex.

<< back to course home
Fall 2009

