msgbartop
同一天地间,同一网络下,P9′Blog与您共享今日互联网→WWW.P9.NET.CN
msgbarbottom

VB制作一个摇奖系统

使用For-Next循环产生1000个1-100之间的随即整数.
首先在窗体上设计一个文本框(Text1)和一个按钮(Command1),上面打上“开始抽奖”,这样按这个键就开始抽奖。
以下是代码:[code]Copy code
Private Sub Command
Dim intranum As Integer,i As Integer,j As Integer,A As Integer
Randomize
For j = 1 To 1000
intranum = Int(100 * Rnd) + 1
a = 0
For j = 1 To 10000
a = a + 1
Next j
Text1.Text = CStr(intranum)
Text1.Refresh
Next i
Text1.Text = CStr(intranum)
End Sub[/code]

Leave a Comment

You must be logged in to post a comment.