Relative0
Member
- Joined
- Sep 15, 2007
- Messages
- 8
- Programming Experience
- 1-3
The problem is that when the application is running I want to be able to push a button, (Say "K") and have an action performed. However when the application starts to run some sort of focus is given to the DataGridView and I am not able to push a button and have the needed action performed. Instead, when a letter is pushed the cell in the DataGridView gets the letter. I assume that this is because the DataGridView has focus. But I don't know how to get the focus to leave the DataGridView so that I can have the "K" counted as a key pressed (while over the form) and have the onKeyDown event fire. But to go a little bit further, Other than the DataGridVeiw being selected, I would like to, if any other control is selected on the form, still be able to press the "K" key and have the keypress code activated. So where do I put this code? And How do I make it so that I can do the keydown event no matter what object is selected, (other than the DatagridView)? I have attached some sample code.
Thanks,
Brian
Thanks,
Brian
Attachments
Last edited by a moderator: