Okay, sparky, here's the deal:
You should use actual graphics commands for this, but I'll still work with your grid of buttons. On a similar note, you should change the buttons to SHAPE objects. These can't get the focus and bugger things up, and you can make them all kinds of kewl shapes like rounded boxes. An alternative would also be a bunch of image controls... But that's off the subject.
The keycodes in VB are as follows:
Up, 38
Down, 40
Left, 37
Right, 39
You would want something like this:
Form_Keydown(Shift as integer, Keycode as integer, blah blah)
If Keycode = 40 then
'That which will move thy block down
End if
If Keycode = 37 then
'That which will move thy block left
End if
If Keycode = 39 then
'That which will move thy block right
End if
End Sub
Also, the Keydown event "Skips." Hold down an arrow key and watch the cursor and you'll get what I mean. If you press and hold the button, the block will move one square, delay a second, and then rapidly continue to move. To remedy this, make a global variable (DIM it in the General Declarations section) called MoveDir as String. Then, you would have this:
Form_Keydown(Shift as integer, Keycode as integer, blah blah)
If Keycode = 40 then
MoveDir = "D"
End if
If Keycode = 37 then
MoveDir = "L"
End if
If Keycode = 39 then
MoveDir = "R"
End if
End Sub
Then in your timer:
Sub Timer1_Timer()
If MoveDir = "D" then
'Move block down 1 space
End if
If MoveDir = "L" then
'Move block left 1 space
End if
If MoveDir = "R" then
'Move block right 1 space
End if
End Sub
If you have any questions/problems/gripes/bitches/death threats, bother me at [email protected]