Public Class Form1 |
  Dim x, y As Integer |
|
  rivate Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load |
    x = 0 |
    y = 0 |
    Timer1.Interval = 100 |
    Timer1.Enabled = True |
  End Sub |
|
  rivate Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick |
    Dim g As Graphics |
    g = CreateGraphics() |
    g.Clear(Color.White) |
    x = x + 1 |
    y = y + 1 |
    g.FillEllipse(Brushes.Aquamarine, x, y, 30, 30) |
|
    If (x + 60 > Me.Width) Then |
      Timer1.Enabled = False |
    End If |
  End Sub |
End Class |