如何用VB设计匀速圆周运动的程序

来源:百度知道 编辑:UC知道 时间:2024/06/08 16:12:33
最好能用PICTURE画图的 麻烦把程序都告诉我 谢谢
是用利用VB6.0做的程序

看看符合要求不?
Option Explicit
Dim x, y As Integer '匀速旋转小球的位置
Dim A As Integer '角度
Private Sub Form_Load()
Show
Me.Picture1.Width = 2000
Me.Picture1.Height = 2000
Me.Picture1.Scale (-1000, -1000)-(1000, 1000)
A = 0
Me.Timer1.Interval = 100
End Sub

Private Sub Timer1_Timer()

Me.Picture1.Cls
Me.Picture1.Circle (0, 0), 500
Me.Picture1.PSet (0, 0)
A = A + 1
If A = 360 Then A = 0
x = 500 * Sin(A)
y = 500 * Cos(A)

Me.Picture1.Circle (x, y), 20, vbRed
End Sub