RT
求100来字的VB编程.内容是有关动画设计的!!!谢咯
答案:1 悬赏:10 手机版
解决时间 2021-04-14 14:25
- 提问者网友:我是我
- 2021-04-14 04:01
最佳答案
- 五星知识达人网友:舍身薄凉客
- 2021-04-14 05:36
一段VB编写的下雪的代码,直接复制黏贴到窗体中运行即可
Dim Snow(1000, 2), Amounty As Integer
Private Sub Form_Load()
Me.Show
Me.BackColor = &H0&
DoEvents
Randomize
Amounty = 325
For J = 1 To Amounty
Snow(J, 0) = Int(Rnd * Form1.Width)
Snow(J, 1) = Int(Rnd * Form1.Height)
Snow(J, 2) = 10 + (Rnd * 3)
Next J
Do While Not (DoEvents = 0)
For LS = 1 To 10
For I = 1 To Amounty
OldX = Snow(I, 0): OldY = Snow(I, 1)
Snow(I, 1) = Snow(I, 1) + Snow(I, 2)
If Snow(I, 1) > Form1.Height Then
Snow(I, 1) = 0: Snow(I, 2) = 5 + (Rnd * 30)
Snow(I, 0) = Int(Rnd * Form1.Width)
OldX = 0: OldY = 0
End If
Coloury = 8 * (Snow(I, 2) - 10): Coloury = 60 + Coloury
PSet (OldX, OldY), QBColor(0)
PSet (Snow(I, 0), Snow(I, 1)), RGB(Coloury, Coloury, Coloury)
Next I
Next LS
Loop
End
End Sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯