Hallo!
Ich wollte in meinem Programm eine PicBox mit den Pfeiltasten bewegen. Aber es tut sich nichts. Im TryCatch Block wird nichts gesagt und im Compiler auch nicht. Ich habe es auch schon mit e.KeyCode probiert.
Ich wollte in meinem Programm eine PicBox mit den Pfeiltasten bewegen. Aber es tut sich nichts. Im TryCatch Block wird nichts gesagt und im Compiler auch nicht. Ich habe es auch schon mit e.KeyCode probiert.
VB.NET-Quellcode
- Try
- If GetAsyncKeyState(Keys.Right) = True Then
- 'If kollision(New Rectangle(player.Location.X + 5, player.Location.Y, player.Size.Width, player.Size.Height)) = False Then
- MsgBox("hi")
- player.Location = New Point(player.Location.X + 5, player.Location.Y)
- Me.Refresh()
- 'End If
- ElseIf GetAsyncKeyState(Keys.Left) = True Then
- 'If kollision(New Rectangle(player.Location.X - 5, player.Location.Y, player.Size.Width, player.Size.Height)) = False Then
- player.Location = New Point(player.Location.X - 5, player.Location.Y)
- 'Me.Refresh()
- 'End If
- ElseIf e.KeyCode = Keys.Up Then
- 'If kollision(New Rectangle(player.Location.X, player.Location.Y - 5, player.Size.Width, player.Size.Height)) = False Then
- player.Location = New Point(player.Location.X, player.Location.Y - 5)
- 'Me.Refresh()
- 'End If
- ElseIf e.KeyCode = Keys.Down Then
- 'If kollision(New Rectangle(player.Location.X, player.Location.Y + 5, player.Size.Width, player.Size.Height)) = False Then
- player.Location = New Point(player.Location.X, player.Location.Y + 5)
- 'Me.Refresh()
- 'End If
- End If
- Catch ex As Exception
- MsgBox(ex.ToString)
- End Try
Whos Faster ALPHA: Bald....