在VB.NET中如何实现下面的效果?
我想实现一种效果,当按下一个按钮时,循环随机生成一个数,就像电视上那种幸运顾客抽奖的程序一样,当按下一个按钮时开始滚动,按下另一个按钮停止下来的号码就是中奖的号码!但是我不知道怎么实现,希望各位高手能指点指点一下,最好能把代码给写出来 ,因为我还是一个初学者!
拖一个label,两个button和一个timer到form上,然后程序如下
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = False
Timer1.Interval = 50 '可调速度
Label1.Text = 0
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = CInt(40 * Rnd()) '调整数值范围
End Sub
End Class