VB画同心圆程序,每隔一秒钟在窗体中央画60个(两圆间距50)颜色随机的同心圆,当有鼠标按下时,结束程序
答案:2 悬赏:80 手机版
解决时间 2021-02-06 03:54
- 提问者网友:喧嚣尘世
- 2021-02-05 21:43
谢谢
最佳答案
- 五星知识达人网友:舍身薄凉客
- 2021-02-05 23:02
Dim i As Integer
Dim j As Integer
Private Sub Form_Load()
j = 0
For i = 0 To 60
Me.Circle (10000, 10000), j, RGB((255 + 1) * Rnd, (255 + 1) * Rnd, (255 + 1) * Rnd)
j = j + 50
Next
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Unload Me
End Sub
Private Sub Timer1_Timer()
For i = 0 To 60
Me.Circle (10000, 10000), j, RGB((255 + 1) * Rnd, (255 + 1) * Rnd, (255 + 1) * Rnd)
j = j + 50
Next
End Sub
窗体上放timer控件
Dim j As Integer
Private Sub Form_Load()
j = 0
For i = 0 To 60
Me.Circle (10000, 10000), j, RGB((255 + 1) * Rnd, (255 + 1) * Rnd, (255 + 1) * Rnd)
j = j + 50
Next
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Unload Me
End Sub
Private Sub Timer1_Timer()
For i = 0 To 60
Me.Circle (10000, 10000), j, RGB((255 + 1) * Rnd, (255 + 1) * Rnd, (255 + 1) * Rnd)
j = j + 50
Next
End Sub
窗体上放timer控件
全部回答
- 1楼网友:夜余生
- 2021-02-05 23:56
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 16
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Unload Me
End Sub
Private Sub Timer1_Timer()
Static i
Randomize
Me.Circle (Me.ScaleWidth / 2, Me.ScaleHeight / 2), i, Rnd * 256 * 256 * 256
i = i + 50
If i > 3000 Then i = 0
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯