Public Class Form1 Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown If e.KeyCode = Keys.Left Then Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 5, Me.PictureBox1.Location.Y) End If If e.KeyCode = Keys.Right Then Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 5, Me.PictureBox1.Location.Y) End If If e.KeyCode = Keys.Up Then Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 5) End If If e.KeyCode = Keys.Down Then Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 5) End If End Sub End Class
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionIf Rectangle.Intersect(picturebox1.bounds, picturebox2.bounds) <> Rectangle.Empty Then ...
If Rectangle.Intersect(PictureBox1.Bounds, Me.ClientRectangle) <> PictureBox1.Bounds Then MessageBox.Show("picturebox1 est sorti du formulaire") End If
If e.KeyCode = Keys.Up Then Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.image = my.resources.a1 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.image = my.resources.a2 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.image = my.resources.a3 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.image = my.resources.a4 End If
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load PictureBox1.Image = My.Resources.aa1 End Sub
If e.KeyCode = Keys.NumPad8 Then 'haut Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 5) If PictureBox1.BackgroundImage Is My.Resources.a1 Then PictureBox1.BackgroundImage = My.Resources.a2 ElseIf PictureBox1.BackgroundImage Is My.Resources.a2 Then PictureBox1.BackgroundImage = My.Resources.a3 ElseIf PictureBox1.BackgroundImage Is My.Resources.a3 Then PictureBox1.BackgroundImage = My.Resources.a4 ElseIf PictureBox1.BackgroundImage Is My.Resources.a4 Then PictureBox1.BackgroundImage = My.Resources.a5 ElseIf PictureBox1.BackgroundImage Is My.Resources.a5 Then PictureBox1.BackgroundImage = My.Resources.a6 ElseIf PictureBox1.BackgroundImage Is My.Resources.a6 Then PictureBox1.BackgroundImage = My.Resources.a7 ElseIf PictureBox1.BackgroundImage Is My.Resources.a7 Then PictureBox1.BackgroundImage = My.Resources.a8 ElseIf PictureBox1.BackgroundImage Is My.Resources.a8 Then PictureBox1.BackgroundImage = My.Resources.a9 ElseIf PictureBox1.BackgroundImage Is My.Resources.a9 Then PictureBox1.BackgroundImage = My.Resources.a10 ElseIf PictureBox1.BackgroundImage Is My.Resources.a10 Then PictureBox1.BackgroundImage = My.Resources.a11 ElseIf PictureBox1.BackgroundImage Is My.Resources.a11 Then PictureBox1.BackgroundImage = My.Resources.a12 ElseIf PictureBox1.BackgroundImage Is My.Resources.a12 Then PictureBox1.BackgroundImage = My.Resources.a1 End If End If
If e.KeyCode = Keys.NumPad8 Then 'haut If PictureBox1.BackgroundImage.Equals(My.Resources.a1) Then PictureBox1.BackgroundImage = My.Resources.a2 PictureBox1.BackgroundImage = My.Resources.a2 PictureBox1.BackgroundImage = My.Resources.a3 PictureBox1.BackgroundImage = My.Resources.a4 PictureBox1.BackgroundImage = My.Resources.a5 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 5) If PictureBox1.BackgroundImage.Equals(My.Resources.a5) Then PictureBox1.BackgroundImage = My.Resources.a6 PictureBox1.BackgroundImage = My.Resources.a7 PictureBox1.BackgroundImage = My.Resources.a8 PictureBox1.BackgroundImage = My.Resources.a9 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 5) If PictureBox1.BackgroundImage.Equals(My.Resources.a9) Then PictureBox1.BackgroundImage = My.Resources.a10 PictureBox1.BackgroundImage = My.Resources.a11 PictureBox1.BackgroundImage = My.Resources.a12 PictureBox1.BackgroundImage = My.Resources.a1 End If
Public Class Form1 Dim pas1 As Image = My.Resources.a1 Dim pas2 As Image = My.Resources.a2 Dim pas3 As Image = My.Resources.a3 Dim pas4 As Image = My.Resources.a4 Dim pas5 As Image = My.Resources.a5 Dim pas6 As Image = My.Resources.a6 Dim pas7 As Image = My.Resources.a7 Dim pas8 As Image = My.Resources.a8 Dim pas9 As Image = My.Resources.a9 Dim pas10 As Image = My.Resources.a10 Dim pas11 As Image = My.Resources.a11 Dim pas12 As Image = My.Resources.a12 Dim pas13 As Image = My.Resources.a13 Dim pas14 As Image = My.Resources.a14 Dim pas15 As Image = My.Resources.a15 Dim pas16 As Image = My.Resources.a16 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load PictureBox1.BackgroundImage = pas1 End Sub Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown If Rectangle.Intersect(PictureBox1.Bounds, Me.ClientRectangle) <> PictureBox1.Bounds Then MessageBox.Show("picturebox1 est sorti du formulaire") End If If e.KeyCode = Keys.NumPad8 Then 'haut If PictureBox1.BackgroundImage Is Me.pas1 Then PictureBox1.BackgroundImage = pas2 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas3 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas4 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas5 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) ElseIf PictureBox1.BackgroundImage Is Me.pas5 Then PictureBox1.BackgroundImage = pas6 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas7 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas8 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas9 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) ElseIf PictureBox1.BackgroundImage Is Me.pas9 Then Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas10 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas11 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas12 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas13 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) ElseIf PictureBox1.BackgroundImage Is Me.pas13 Then PictureBox1.BackgroundImage = pas14 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas15 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas16 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas1 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) End If End If If e.KeyCode = Keys.NumPad2 Then 'bas If PictureBox1.BackgroundImage Is Me.pas1 Then PictureBox1.BackgroundImage = pas2 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas3 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas4 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas5 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) ElseIf PictureBox1.BackgroundImage Is Me.pas5 Then PictureBox1.BackgroundImage = pas6 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas7 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas8 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas9 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) ElseIf PictureBox1.BackgroundImage Is Me.pas9 Then PictureBox1.BackgroundImage = pas10 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas11 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas12 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas13 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) ElseIf PictureBox1.BackgroundImage Is Me.pas13 Then PictureBox1.BackgroundImage = pas14 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas15 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas16 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas1 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) End If End If If e.KeyCode = Keys.NumPad4 Then 'left If PictureBox1.BackgroundImage Is Me.pas1 Then PictureBox1.BackgroundImage = pas2 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas3 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas4 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas5 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) ElseIf PictureBox1.BackgroundImage Is Me.pas5 Then PictureBox1.BackgroundImage = pas6 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas7 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas8 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas9 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) ElseIf PictureBox1.BackgroundImage Is Me.pas9 Then PictureBox1.BackgroundImage = pas10 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas11 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas12 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas13 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) ElseIf PictureBox1.BackgroundImage Is Me.pas13 Then PictureBox1.BackgroundImage = pas14 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas15 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas16 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas1 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) End If End If If e.KeyCode = Keys.NumPad6 Then 'right If PictureBox1.BackgroundImage Is Me.pas1 Then PictureBox1.BackgroundImage = pas2 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas3 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas4 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas5 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) ElseIf PictureBox1.BackgroundImage Is Me.pas5 Then PictureBox1.BackgroundImage = pas6 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas7 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas8 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas9 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) ElseIf PictureBox1.BackgroundImage Is Me.pas9 Then PictureBox1.BackgroundImage = pas10 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas11 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas12 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas13 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) ElseIf PictureBox1.BackgroundImage Is Me.pas13 Then PictureBox1.BackgroundImage = pas14 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas15 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas16 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) PictureBox1.BackgroundImage = pas1 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) End If End If If e.KeyCode = Keys.NumPad9 Then 'haut droit If PictureBox1.BackgroundImage Is Me.pas1 Then PictureBox1.BackgroundImage = pas2 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas3 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas4 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas5 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) ElseIf PictureBox1.BackgroundImage Is Me.pas5 Then PictureBox1.BackgroundImage = pas6 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas7 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas8 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas9 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) ElseIf PictureBox1.BackgroundImage Is Me.pas9 Then PictureBox1.BackgroundImage = pas10 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas11 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas12 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas13 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) ElseIf PictureBox1.BackgroundImage Is Me.pas13 Then PictureBox1.BackgroundImage = pas14 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas15 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas16 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas1 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y - 1) End If End If If e.KeyCode = Keys.NumPad7 Then 'haut gauche If PictureBox1.BackgroundImage Is Me.pas1 Then PictureBox1.BackgroundImage = pas2 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas3 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas4 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas5 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) ElseIf PictureBox1.BackgroundImage Is Me.pas5 Then PictureBox1.BackgroundImage = pas6 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas7 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas8 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas9 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) ElseIf PictureBox1.BackgroundImage Is Me.pas9 Then PictureBox1.BackgroundImage = pas10 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas11 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas12 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas13 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) ElseIf PictureBox1.BackgroundImage Is Me.pas13 Then PictureBox1.BackgroundImage = pas14 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas15 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas16 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) PictureBox1.BackgroundImage = pas1 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y - 1) End If End If If e.KeyCode = Keys.NumPad3 Then 'bas droit If PictureBox1.BackgroundImage Is Me.pas1 Then PictureBox1.BackgroundImage = pas2 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas3 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas4 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas5 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) ElseIf PictureBox1.BackgroundImage Is Me.pas5 Then PictureBox1.BackgroundImage = pas6 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas7 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas8 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas9 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) ElseIf PictureBox1.BackgroundImage Is Me.pas9 Then PictureBox1.BackgroundImage = pas10 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas11 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas12 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas13 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) ElseIf PictureBox1.BackgroundImage Is Me.pas13 Then PictureBox1.BackgroundImage = pas14 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas15 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas16 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas1 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y + 1) End If End If If e.KeyCode = Keys.NumPad1 Then 'bas gauche If PictureBox1.BackgroundImage Is Me.pas1 Then PictureBox1.BackgroundImage = pas2 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas3 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas4 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas5 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) ElseIf PictureBox1.BackgroundImage Is Me.pas5 Then PictureBox1.BackgroundImage = pas6 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas7 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas8 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas9 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) ElseIf PictureBox1.BackgroundImage Is Me.pas9 Then PictureBox1.BackgroundImage = pas10 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas11 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas12 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas13 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) ElseIf PictureBox1.BackgroundImage Is Me.pas13 Then PictureBox1.BackgroundImage = pas14 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas15 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas16 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) PictureBox1.BackgroundImage = pas1 Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y + 1) End If End If End Sub End Class