Upload
samurai-red
View
577
Download
2
Embed Size (px)
Citation preview
Microsoft
Small Basic
Public Class Form1Dim x, y As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles MyBase.Loadx = 0y = 0Timer1.Interval = 100Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Timer1.TickDim g As Graphicsg = CreateGraphics()g.Clear(Color.White)x = x + 1y = y + 1g.FillEllipse(Brushes.Aquamarine, x, y, 30, 30)
If (x + 60 > Me.Width) ThenTimer1.Enabled = False
End IfEnd Sub
End Class
画面の上を円が左上から右下へと移動する処理を「Visual Basic」で記述したコード
x=0
y=0
ball = Shapes.AddEllipse(30,30)
For x=0 To GraphicsWindow.Width
Shapes.Move(ball, x, y )
y=y+1
Program.Delay(10)
EndFor
画面の上を円が左上から右下へと移動する処理を「Small Basic」で記述したコード