我想用VB制作一个抽奖型的转盘

我想用VB制作一个抽奖型的转盘,第1张

这是一个转兆和盘 转到的位置是随机的 具体奖品需要你自孝猜祥己定 我就不帮你了..... 这一句 If c >95 Then Timer1.Interval = 0 这个95 改的越小 停的越快巧搏,转到的位置重复的几率也就越大 . 代码细看看, 数值都是活的 可以根据自己需要改.

'添加控件 timer1 command1 line1

Dim x1%, y1%

Dim a As String

Private Sub Command1_Click()

a = 0

Timer1.Interval = 50

End Sub

Private Sub form_load()

Me.AutoRedraw = True

x1 = Me.Width \ 2

y1 = (Me.Height - 405) \ 2

Line1.x1 = x1: Line1.y1 = y1

Me.DrawWidth = 5

Me.Circle (x1, y1), 3000

Line1.BorderWidth = 5

Line1.BorderColor = QBColor(14)

End Sub

Private Sub Timer1_Timer()

Randomize

c = Int((100) * Rnd + 1)

a = a + 1

If a >24 Then Timer1.Interval = 100

If a >40 Then Timer1.Interval = 200

If a >48 Then

Timer1.Interval = 300

If c >95 Then Timer1.Interval = 0

End If

b = (3.14 / 8) * a

Line1.X2 = Line1.x1 + (3000 * Sin(b))

Line1.Y2 = Line1.y1 - (3000 * Cos(b))

End Sub

if {%1}=={} @echo Syntax: MSDTC1 Filename&goto :EOF

setlocal ENABLEDELAYEDEXPANSION

set filename=%1

if exist %filename% del /q %filename%

(

.版本 2

.程序集 窗口程序集1

.程序集变量 位数, 整数型

.子程序 _按钮1_被单击

编辑框2.内容 = “”

.如果 (编辑框1.内容 = “”)

位数 = 取随机数 (1, 10)

.否则

位数 = 到整数 (编猛宏辑返知陆框1.内容)

.如果结束

.计次循环首 (位数, )

编辑框2.加入文本 (到文本 (取随机数 (0, 9)))

延时 (100)

.计次漏顷循环尾 ()


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/12313364.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-22
下一篇2023-05-22

发表评论

登录后才能评论

评论列表(0条)

    保存