程序簡要介紹:
新建一個窗體,在該窗體內(nèi)放入9個標簽控件,其中l(wèi)abel2--label8分別放入選出的號碼;有一個組合框控件,準備存入每次選中的號碼;兩個命令按鈕,分別為“開始選號”與“退出”。
代碼如下:
Option Explicit
Private Sub
Command1_Click() '開始選號
Dim q As Integer
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Dim e As Integer
Dim f As Integer
Dim g As Integer
For q = 1 To 7
Select Case q
Case 1
Randomize (Time)
a = Int(Rnd * 33 + 1)
Label2.Caption = a
Case 2
Do
Randomize (Time)
b = Int(Rnd * 33 + 1)
Loop Until b <> Label2.Caption
Label3.Caption = b
Case 3
Do
Randomize (Time)
c = Int(Rnd * 33 + 1)
Loop Until c <> Label2.Caption And c
<> Label3.Caption
|