Very Busy (VB) Mail Order
Part one is a review from last week on how to complete the first step of every project
Start Visual Basic and Open a New Standard .EXE
Do the housekeeping required to setup your project. This includes:
- Creating a New Project Directory
- Saving the Form
- Saving the Project File
Refer to the Guidelines for this procedure and for the required naming conventions.
User Interface
Reviewing the problem reveals that the user interface will need these considerations:
3 Labels 3 Text Boxes 2 Frames 5 Option Buttons 1 CheckBox 3 Command Buttons |
TabIndexes: Set them in the order that the user will navigate between controls. This is usually Top - Bottom, Left - Right. Keyboard Interface: See that Alt-R will position to the Print Button and that Alt-C will position to the Text Box associated with the Catalog Code. Don't forget the relationship held by the Label and Text Box. Tool Tips: Set the Tool Tip Text for each control Frames as Containers Because there are 2 sets of option buttons, two frames are required so that each catagory can be properly set. |
![]() |
Command Buttons 3 Command Buttons with proper Keyboard Interface. Make the Print Button the Default Button and the Exit Button the Cancel Button. Labels 3 labels keep the default names as they will not be referenced by the program. Be sure to set the TabIndex property correctly so you can associate the label with the proper TextBox Text Boxes Give these 3 controls meaningful names. You will reference them in the Command Button Clear Event Handler detailed below. Frames Frames are Containers. Each of the two frames will hold a separate set of option buttons. Option Buttons Be sure to set one of the set to True Check Box Set the proper KeyBoard Interface
|
Complete the user interface by placing the controls on the form as demonstrated above. Set the Keyboard Interface in the Caption of each control. Set the Tool Tip Text for each control including the Frames and Labels. Properly name the controls which will be referenced in the Event Handlers, that is for the Text Boxes, Option Buttons, Check Box and the Command Buttons. Make sure that the TabIndexes are set in the proper order so that the user can logically tab between the form controls.
When theis is complete, you can run the program by clicking on Run | Start with Full Compile or by pressing CTRL-F5.
Does the form look the way you want it
too?
Do the Tab Indexes, Keyboard Interface, and Tool Tips work right?
When the user interface is complete, continue on with the Event Handler Coding.
Event Handlers
All of the User Events are handled by the Command Buttons
The Exit Command button will "End" the program as in the first weeks lab
The Print Command Button will use the Form's PrintForm method as in the first weeks lab.
The Clear Command Button must:
Test your program to verify that the event handlers work properly
A couple of things to double check:
This completes the first lab