Imports system.Reflection Public Class Form1 Private arrLeft(5) As Bitmap, arrRight(5) As Bitmap Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load arrLeft(0) = My.Resources.L1 : arrLeft(1) = My.Resources.L2 : arrLeft(2) = My.Resources.L3 arrLeft(3) = My.Resources.L4 : arrLeft(4) = My.Resources.L5 : arrLeft(5) = My.Resources.L6 arrRight(0) = My.Resources.R1 : arrRight(1) = My.Resources.R2 : arrRight(2) = My.Resources.R3 arrRight(3) = My.Resources.R4 : arrRight(4) = My.Resources.R5 : arrRight(5) = My.Resources.R6 End Sub Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown Static ind As Integer, LastDir As String Static counter As Integer Select Case e.KeyCode Case Keys.Left If LastDir = Keys.Right Then ind = 0 : counter = 0 If counter Mod 5 = 0 Then PictureBox1.Image = arrLeft(ind Mod 6) Application.DoEvents() PictureBox1.Left -= 10 ind += 1 End If LastDir = Keys.Left Case Keys.Right If LastDir = Keys.Left Then ind = 0 : counter = 0 If counter Mod 5 = 0 Then PictureBox1.Image = arrRight(ind Mod 6) Application.DoEvents() PictureBox1.Left += 10 ind += 1 End If LastDir = Keys.Right End Select counter = counter Mod 21 + 1 End Sub End Class
Shay Noy