怎么用VB实现从左到右滚动的圆?

来源:百度知道 编辑:UC知道 时间:2024/05/16 09:53:22
如题
我写的好像不行
dim a as Integer
for i = 1 to 100
a = a + i
form1.circle (a,1000),500
next

楼上的,form没有clear方法的

正确代码如下:

Dim a As Integer
Dim i As Integer

With Form1

.AutoRedraw = False

For i = 1 To 100
a = a + i
Form1.Circle (a, 1000), 500

Call Sleep(100)

Form1.Cls
Next
End With

End Sub

Private Sub Sleep(ByVal Intervalue As Long)

Dim i As Long

For i = 1 To Intervalue * 1000

Next i

End Sub

sleep()函数也可以用Timer控件替代

dim a as Integer
for i = 1 to 100
a = a + i
form1.circle (a,1000),500
form1.clear
next