求解VB编程:运行时按“逆时针画圆”命令按钮,由定时器控制在以像素
急!求VB大神解答,拜托了 展开
Dim k As Integer
Const PI As Single = 3.1415926
Private Sub Command1_Click()
Me.Timer1.Interval = 100
End Sub
Private Sub Form_Load()
Me.Picture1.Left = 100
Me.Picture1.Top = 100
Me.Picture1.Height = 6000
Me.Picture1.Width = 6000
Me.Picture1.ScaleMode = 3
Me.Picture1.DrawWidth = 2
Me.Height = 100 + Me.Picture1.Height + 1000
Me.Width = 100 + Me.Picture1.Width + 250
Me.Command1.Height = 335
Me.Command1.Width = 1665
Me.Text1.Height = 255
Me.Text1.Width = 730
Me.Text1.Left = 480
Me.Text1.Top = 6270
Me.Command1.Left = (Me.Width - Me.Command1.Width) / 2
Me.Command1.Top = 100 + Me.Picture1.Height + 120
Me.Timer1.Interval = 0
End Sub
Private Sub Timer1_Timer()
Me.Text1.Text = Time
Me.Picture1.PSet (Me.Picture1.ScaleWidth / 2 - (Me.Picture1.ScaleWidth / 2 - 10) * Cos(-PI / 2 + k * PI / 180), Me.Picture1.ScaleHeight / 2 + (Me.Picture1.ScaleWidth / 2 - 10) * Sin(-PI / 2 + k * PI / 180)), vbRed
k = k + 1
If k >= 360 Then
Me.Timer1.Interval = 0
Me.Timer1.Enabled = False
End If
End Sub