Hi,

In my vb.net application, it seems that the KeyUp events and Timer Tick events cant be processed simulatanously. When I press the Up arrow key, the timer tick event does not seem to work.

Both events move a picturebox control each. The KeyUp events move the picturebox up and down the form while the timer tick event moves another picturebox from right to left at 1 pixel for each tick.

The problem occurs when I press the Up arrow key. The first picturebox moves up and down the screen. But while the Up arrow key is pressed, the other picturebox, controlled by the timer tick event, stops moving.
Only when I release the Up arrow key does the timer tick event resume and start moving the other picturebox across the form.

The line of code for the timer tick event is:

PictureBox10.Location = New Point(PictureBox10.Location.X - 1,
PictureBox10.Location.Y)


The code for the Key Down event consists of 2 while loops to move the picturebox up and down the form. One while loop is shown below:

While ((Form1.PictureBox3.Location.Y > 80) And hitTop = 0)

Form1.PictureBox3.Location = New Point(Form1.PictureBox3.Location.X, Form1.PictureBox3.Location.Y - 1)

If (Form1.PictureBox3.Location.Y <= 80) Or hitTop = 1 Then
hitTop = 1
End If

End While


How do I make both events occur simultanously? e.g when the up arrow key is pressed, one picturebox 'jumps' up and down the form while the timer tick event still moves the other picturebox across the form