Microsoft Visual Basic 6 Professional (step by step)
Add the number labels
Now add the labels used to display the numbers in the program. A label is a special user interface element designed to display text, numbers, or symbols when a program runs. When the user clicks the Lucky Seven program’s Spin button, three random numbers appear in the label boxes. If one of the numbers is a seven, the user hits the jackpot.
- Click the Label control in the toolbox, and then place the mouse pointer over the form.
Label control
The Label control is selected, and the mouse pointer changes to crosshairs when it rests on the form.
- Create a small rectangular box like the one shown below.
The label object you have created is called Label1, the first label in the program. Now you’ll create two more labels, named Label2 and Label3, on the form.

- Click the Label control, and then draw a label box to the right of the first label.
Make this label the same size as the first. The caption "Label2" will appear in the label.
- Click the Label control again and add a third label to the form, to the right of the second label.
The caption "Label3" will appear in the label.
next page....
|