Objectives:
- Create a Visual Basic Clock
|
The Digital Clock
- Create a new Visual Basic Project.
- Drag a label onto the form.
- Erase the caption. Leave the caption property blank.
Note: The caption property is not the same as the name property. The name property is at the very top of the list of properties.
- Change the name property of the label to lblTime.
- Change the font property of the label to a style and size you like.
- Take a look at the timer icon on your tools.
- Drag the timer icon onto the form.
- Change the Interval property to 1000.
- Double-click the timer button and add the following code:
lblTime = time
- Drag a command button onto the form.
- Double click the command button and add the following code:
end
- Test your program.
- Repeat the process to make an additional timer that uses a different font to display the time. Note: When you add a second label, you must use a different name. Name it lblTime2. When you write the code for the second timer, you will type: lblTime2 = time
- Change the background colors and add descriptive labels and graphics to your program.
<< Back to Skyline
|