[求助]用VB编一个随机抽奖的程序
还要用一个时钟控件产生时间[此贴子已经被作者于2007-6-2 15:35:09编辑过]
[此贴子已经被作者于2007-6-2 15:35:09编辑过]
Private Sub Label2_Click()
If Label2.Caption = "抽奖" Then
Timer1.Interval = 10
Label2.Caption = "停止"
ElseIf Label2.Caption = "停止" Then
Timer1.Interval = 0
MsgBox "恭喜" & Label1.Caption & "中奖者", 64, "^^"
Label2.Caption = "抽奖"
End If
Label1.Caption = ""
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Int(Rnd * 100)
End Sub