VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 7425 ClientLeft = 60 ClientTop = 450 ClientWidth = 11130 LinkTopic = "Form1" ScaleHeight = 7425 ScaleWidth = 11130 StartUpPosition = 3 'Windows Default Begin VB.CommandButton Command1 Caption = "Command1" Height = 495 Left = 4920 TabIndex = 0 Top = 3360 Width = 1215 End Begin VB.Timer Timer1 Left = 480 Top = 6720 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim BaseTop As Double Dim BaseLeft As Double Dim Radius As Double Dim N As Double Dim Increment As Double Dim twoPI As Double Private Sub SetPosition() Dim left As Long Dim top As Long left = (-Radius) + (Cos(N) * Radius) + BaseLeft top = (Sin(N) * Radius) + BaseTop Command1.top = top Command1.left = left Form1.Refresh End Sub Private Sub Command1_Click() N = 0 Timer1.Interval = 20 Timer1.Enabled = True SetPosition End Sub Private Sub Form_Load() Increment = 0.031415926 twoPI = (3.1415926 * 2) BaseTop = Command1.top BaseLeft = Command1.left Radius = 1000 End Sub Private Sub Timer1_Timer() N = N + Increment If N > twoPI Then N = 0 Timer1.Enabled = False End If SetPosition End Sub