Dim LL%, UU%
Dim zjHm$
Dim Sorted As Boolean
Private Sub Command1_Click()
On Error GoTo mEnd
If Sorted = True Then Label2.Caption = "": zjHm = "": Sorted = False
Select Case Command1.Caption
Case "开始"
LL=1
UU=10
Command1.Caption = "停止"
Timer1.Interval = 50
Timer1.Enabled = True
Call Timer1_Timer
Case "停止"
Timer1.Enabled = False
Command1.Caption = "开始"
zjHm = zjHm & Label1.Caption & " "
Label2.Caption = zjHm
End Select
mEnd:
End Sub
按钮的Caption应为 开始,这个是判断按钮名称来决定动作的
设计上有问题,1-10随机滚动比按序滚动更好
Private Sub Command1_Click()
Timer1.Enabled = Not Timer1.Enabled
End Sub
Private Sub Timer1_Timer()
Randomize
Label1.Caption = Int(10 * Rnd + 1)
End Sub
Private Sub Command1_Click()
If Command1.Caption = "开始" Then
Timer1.Enabled = True
Command1.Caption = "停止"
Else
Command1.Caption = "开始"
Timer1.Enabled = False
End If
End Sub
Private Sub Form_Load()
Command1.Caption = "开始"
Timer1.Interval = 50
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Static a
a = a + 1
Label1 = a
If a = 10 Then a = 0
End Sub
Private Sub Command1_Click()
If Timer1.Enabled = False Then
Timer1.Enabled = True
Command1.Caption = "停止"
Else
Timer1.Enabled = False
Command1.Caption = "开始"
End If
End Sub
Private Sub Form_Load()
Label1 = ""
Label1.FontSize = 30
Timer1.Interval = 50
Timer1.Enabled = False
Command1.Caption = "开始"
End Sub
Private Sub Timer1_Timer()
DoEvents
k = Val(Label1) + 1
If k > 10 Then k = 1
Label1 = k
End Sub
抽奖思路还是看”幸运魔方“的一些开发好的抽奖产品案例 ,分享微博,上下滚动形式列出抽奖名单。界面比较有创意 砸金蛋、转盘。 网页php抽奖程序
标签:vb,抽奖,程序