Hallo ich habe ein Problem
Mein Code:
Und mein Problem:
wenn ich mit den Pfeiltasten oder WASD das Panel bewegen möchte, funktioniert das gut, aber manchmal ruckelt es sehr stark. Ich drücke dabei nicht zwei Tasten auf einmal, obwohl ich das Problem ja schon mit ElseIf behoben hätte.
Weiß jemand, warum?
Mein Code:
VB.NET-Quellcode
- Private Sub movingTimer_Tick(sender As System.Object, e As System.EventArgs) Handles movingTimer.Tick
- Dim steps As Integer = 20
- If GetAsyncKeyState(Keys.S) Or GetAsyncKeyState(Keys.Down) Then
- If Panel2.VerticalScroll.Value + steps <= Panel2.VerticalScroll.Maximum Then
- Panel2.VerticalScroll.Value += steps
- End If
- elseIf GetAsyncKeyState(Keys.W) Or GetAsyncKeyState(Keys.Up) Then
- If Panel2.VerticalScroll.Value - steps >= Panel2.VerticalScroll.Minimum Then
- Panel2.VerticalScroll.Value -= steps
- End If
- End If
- If GetAsyncKeyState(Keys.D) Or GetAsyncKeyState(Keys.Right) Then
- If Panel2.HorizontalScroll.Value + steps <= Panel2.HorizontalScroll.Maximum Then
- Panel2.HorizontalScroll.Value += steps
- End If
- ElseIf GetAsyncKeyState(Keys.A) Or GetAsyncKeyState(Keys.Left) Then
- If Panel2.HorizontalScroll.Value - steps >= Panel2.HorizontalScroll.Minimum Then
- Panel2.HorizontalScroll.Value -= steps
- End If
- End If
- Panel2.Update()
- Panel2.Refresh()
- End Sub
Und mein Problem:
wenn ich mit den Pfeiltasten oder WASD das Panel bewegen möchte, funktioniert das gut, aber manchmal ruckelt es sehr stark. Ich drücke dabei nicht zwei Tasten auf einmal, obwohl ich das Problem ja schon mit ElseIf behoben hätte.
Weiß jemand, warum?
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „phil“ ()