Hallo liebe Programmierer...
Ich hab ein Problem, ich will mit den Pfeiltasten eine einfache PictureBox1 im Form bewegen.
Bei meinem bisherigen code meldet VB keine Fehler, aber er funtzt net!!!
|
VisualBasic Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
Private Sub FormKeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
If e.KeyCode = Keys.Up Then
PictureBox1.Location = New Point(PictureBox1.Location.X - 0, PictureBox1.Location.Y - 10)
ElseIf e.KeyCode = Keys.Down Then
PictureBox1.Location = New Point(PictureBox1.Location.X + 0, PictureBox1.Location.Y + 10)
ElseIf e.KeyCode = Keys.Right Then
PictureBox1.Location = New Point(PictureBox1.Location.X + 10, PictureBox1.Location.Y + 0)
ElseIf e.KeyCode = Keys.Left Then
PictureBox1.Location = New Point(PictureBox1.Location.X - 10, PictureBox1.Location.Y - 0)
End If
End Sub
|
Was ist da los das das net geht?
und fals ich es föllig falsh gemacht habe oder irgendwas vergessen habe, dan verbessert es bitte oder fügt es hinzu!
Vielen dank Schonmal im Voraus,
Michael
Edit: Ich habe Microsoft Visual Basic Express 2008!