Click here to Skip to main content
15,893,486 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all
i'm working on a project, there is a part of it concerning of keyboard arrows(left, right, up and down), and there is 4 buttons each button do the task of a specific arrow.
what is the code to let the button do the task for the arrow?
Posted

1 solution

Are you aware that depending on the control that's got focus, the arrow keys may or may not already have a specific action they perform? We have to know what you're trying to accomplish before we can give you a precise answer to your question.

EDIT ======================

Add event handlers to your form for keydown and keyup, and inside those handlers, determine if the keys are arrow keys. Remember, there are two sers of arrow keys on a standard keyboard.
 
Share this answer
 
v2
Comments
graduate student 23-Dec-11 9:03am    
i need them for controlling a game

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900