Senin, 16 Juni 2008

Animasi Bola

Dim x, y As Integer
Private Sub Form_Load()
Form1.ScaleWidth = 400
Form1.ScaleHeight = 100
x = 10: y = 10
Shape1.Top = y
Shape1.Left = x
Timer1.Enabled = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
x = x + 5: If x > 350 Then x = 1
Shape1.Top = y
Shape1.Left = x
Shape1.Refresh
End Sub

Tidak ada komentar: