Arrow Key movement, buttons

goatst22

New member
Joined
Jan 26, 2007
Messages
2
Programming Experience
Beginner
Hello everyone, I really hope I can get some help on this because it has been frustrating me for quite some time now.

Background:
I am making a Sudoku program using Visual Basic .NET (2003). I am quite new to this being I started VB .NET Programming class in college only 6 weeks ago, but between playing with the program out of class, and having knowledge of Microsoft FrontPage, I have a decent working knowledge of how coding is to be done.

What I have:
My Sudoku is set up into a grid of buttons set into an array. 3x3 squares, set into a 3x3 grid... thus 9 squares containg 9 buttons each.

What I need:
I would like to be able to navagate around the grid of buttons using the arrow keys. Tabing is fine, but I dont want to tab 81 times to reach from one end to the other. I have tried using the arrows as a tab, but that only allows me to go back and forth in tab order. I want to forget about the tab order and move freely around the grid using Up, Down, Left, and Right.

If anyone can help me out on this it would be much appreciated. Thank you.
 
You are going to want to look into the e.keycode in the KeyPressEventArgs. Do some googling and you should find out how to do it.
 
cool, thank you very much for pointing me in the right direction. perhaps now I can put this prblem to an end haha. Thanks
 
it would be a matter of using the form's keyup event to determine if the key that was pressed was an arrow key, then setting focus on the button that should have focus next (not the tab order)

ie
if the button 5,2 (fifth row down, second column in) has focus and the user presses the left <- arrow key, it'll give the button 5,1 focus
 
Back
Top