VB要怎样画一个圆,点击时其自动扩大和缩小

来源:百度知道 编辑:UC知道 时间:2024/06/15 21:49:11
能否解释一下Timer1.Enabled = Not Timer1.Enabled

CB
在其中的作用,我是初学者,不是很懂,谢谢!

Dim R As Long, CB As Boolean
Private Sub Form_Click()
R = 500
Timer1.Interval = 10
Timer1.Enabled = Not Timer1.Enabled
End Sub

Private Sub Timer1_Timer()
Cls
If CB = False Then
R = R + 3
If R >= 800 Then CB = True
Else
R = R - 3
If R <= 500 Then CB = False
End If
Form1.Circle (Form1.ScaleWidth / 2, Form1.ScaleHeight / 2), R
End Sub

添加一个计时器,运行后,你点击窗体看看