Private Sub Command1_Click()
Label1.Caption = Fix(Rnd * (0 - 33 + 1)) + 33
Label2.Caption = Fix(Rnd * (0 - 33 + 1)) + 33
Label3.Caption = Fix(Rnd * (0 - 33 + 1)) + 33
Label4.Caption = Fix(Rnd * (0 - 33 + 1)) + 33
Label5.Caption = Fix(Rnd * (0 - 33 + 1)) + 33
Label6.Caption = Fix(Rnd * (0 - 33 + 1)) + 33
Label7.Caption = Fix(Rnd * (0 - 33 + 1)) + 33
End SubPrivate Sub Command2_Click()
End
End SubPrivate Sub Command3_Click()
Label1.Caption = " "
Label2.Caption = " "
Label3.Caption = " "
Label4.Caption = " "
Label5.Caption = " "
Label6.Caption = " "
Label7.Caption = " "
End SubPrivate Sub Form_Load()
Label1.Caption = " "
Label2.Caption = " "
Label3.Caption = " "
Label4.Caption = " "
Label5.Caption = " "
Label6.Caption = " "
Label7.Caption = "特殊号码"
End Sub是个生成彩票的程序
怎么让随机生成的数字不一样???
Randomize '加这句
Label1.Caption = Fix(Rnd * (0 - 33 + 1)) + 33
Label2.Caption = Fix(Rnd * (0 - 33 + 1)) + 33
Label3.Caption = Fix(Rnd * (0 - 33 + 1)) + 33
Label4.Caption = Fix(Rnd * (0 - 33 + 1)) + 33
Label5.Caption = Fix(Rnd * (0 - 33 + 1)) + 33
Label6.Caption = Fix(Rnd * (0 - 33 + 1)) + 33
Label7.Caption = Fix(Rnd * (0 - 33 + 1)) + 33
End Sub
Dim I as Long
For I =0 to label1.count-1
Label1(I).Caption = Fix(Rnd * 33) '你真的不知道Fix(Rnd*(0-33+1))+33是几么?
Next
End SubPrivate Sub Command2_Click()
Unload Me '即使要写End也放到Form_Unload事件中写,养成好习惯。
End SubPrivate Sub Command3_Click()
Dim I as Long
For I=0 to label1(I).count-1
Label1(I).Caption=""
Next
End SubPrivate Sub Form_Load()
Dim I as Long
For I=0 to Label1.Count-2
Label1(I).Caption = ""
Next
Label1(I).Caption = "特殊号码"
End Sub能自己算的,别都交给CPU。
选中按“CTRL+C”再点回复处按“CTRL+C”了