Utiliser les touches directionnelles en .net
Résolu
Alvin1614
Messages postés
107
Date d'inscription
Statut
Membre
Dernière intervention
-
cs_Le Pivert Messages postés 7904 Date d'inscription Statut Contributeur Dernière intervention -
cs_Le Pivert Messages postés 7904 Date d'inscription Statut Contributeur Dernière intervention -
A voir également:
- Utiliser les touches directionnelles en .net
- Touches rémanentes - Guide
- Net framework 2.0 - Télécharger - Divers Utilitaires
- Utiliser chromecast - Guide
- Paint net - Télécharger - Dessin & Illustration
- Net framework 4.0 - Télécharger - Divers Utilitaires
2 réponses
yg_be
Messages postés
23541
Date d'inscription
Statut
Contributeur
Dernière intervention
Ambassadeur
1 584
bonsoir, peut-être:
Me.PictureBox1.Location = New Point(Me.PictureBox1.Location.X , Me.PictureBox1.Location.Y -1)
Bonjour,
Comme ceci:
Voilà
Comme ceci:
Option Strict On Public Class Form1 Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown Select Case e.KeyCode Case Keys.Down If Me.PictureBox1.Location.Y = Me.Height - PictureBox1.Height Then Exit Sub Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y + 1) Case Keys.Up If Me.PictureBox1.Location.Y = 0 Then Exit Sub Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X, Me.PictureBox1.Location.Y - 1) Case Keys.Left If Me.PictureBox1.Location.X = 0 Then Exit Sub Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X - 1, Me.PictureBox1.Location.Y) Case Keys.Right If Me.PictureBox1.Location.X = Me.Width - PictureBox1.Width Then Exit Sub Me.PictureBox1.Location = New System.Drawing.Point(Me.PictureBox1.Location.X + 1, Me.PictureBox1.Location.Y) End Select End Sub End Class
Voilà
ou
J'ai pas testé
Je ne peut donc tester vos solutions étant donné qu'il m'affiche : 'KeyCode' n'est pas un membre de 'System.EventArgs'.