程序簡要介紹:
新建一個(gè)窗體,在該窗體內(nèi)放入9個(gè)標(biāo)簽控件,其中l(wèi)abel2--label8分別放入選出的號(hào)碼;有一個(gè)組合框控件,準(zhǔn)備存入每次選中的號(hào)碼;兩個(gè)命令按鈕,分別為“開始選號(hào)”與“退出”。
代碼如下:
Option Explicit
Private Sub
Command1_Click() '開始選號(hào)
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
|