Visual Basicがわかりません。
Public Class Form1
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim GraphicsFun As System.Drawing.Graphics
GraphicsFun = Me.CreateGraphics
Dim PenColor As New System.Drawing.Pen _
(System.Drawing.Color.Black)
GraphicsFun.DrawRectangle(PenColor, 30, 30, 450, 300)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If PictureBox1.Left < 480 - PictureBox1.Width And PictureBox1.Top + 31 Then
PictureBox1.Left = PictureBox1.Left + 1
Else
If PictureBox1.Top < 330 - PictureBox1.Height Then
PictureBox1.Top = PictureBox1.Top + 1
Else
If PictureBox1.Left > 30 Then
PictureBox1.Left = PictureBox1.Left - 1
Else
If PictureBox1.Top > 30 And PictureBox1.Left + 31 Then
PictureBox1.Top = PictureBox1.Top - 1
End If
End If
End If
End If
End Sub
End Class
ピクチャーボックスを四角形の中で右周りに枠の中をボタンを押すと回るようにしたいんですけど、2回目の動作と3回目の動作がかぶってしまい、うまくいきません。4回目の解決策を教えてください。また、ボタン2を押すと反対周りにピクチャーボックスが回る、コマンドを
教えてください。