|
- Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) '参数是长整形(毫秒数)。Lib “kernel32”标明这个函数是引用kernel32.dll提供的函数。Kernel32.dll是windows的四个核心库之一。是用来延时n毫秒的?
- Dim f As Boolean '将循环控制定义为共享变量很重要!否则停止按钮将失效!
- Private Sub CommandButton1_Click()
- f = False
- If Me.CommandButton1.Caption = "停止" Then
- Me.CommandButton1.Caption = "开始"
- f = True
- Else
- Me.CommandButton1.Caption = "停止"
- TextBox2.Text = "" '清除界面的上次奖等数据
- Do
- If f Then Exit Do
- TextBox2.Text = Int(Rnd * 50) + 1
- Sleep 30
- DoEvents
- Loop
- End IfEnd Sub
复制代码
依次逐等抽奖并集中抽奖结果-h.rar
(56.5 KB, 下载次数: 12)
|
|