24. Public Class Form1
Dim x, y As Integer
Private 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
Private 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
画面の上を円が左上から右下へと移動する処理を「Visual Basic」で記述したコード