How to make shortcut/hotkey
-
I can't use certain key(ex:Enter key) for shortcut when the focus is on the datagrid. I already tried to use the datagrid KeyDown events but it seems not work right. I must click the rowheader and then the Enter key(the shorcut I use) to fire the keydown event. If i don't do this the events seem not work even if i already use the command datagrid.focus() to focus to the datagrid. I also notice that i can't use the arrow key (Up and down key) to select the row i want. The triangle point at the row header move when i use the arrrow keys but again i can't use the shortcut (Enter Key) to make selection. It really bothers me to use mouse every time i want to make a row selected. I'm also try several other method to accomplish this. I tried to use the form keydown events and already set the form KeyPreview property to true, I also tried to use the overrides PreProcessMessage function but the problem cannot be solved. The last method I use is using the menu control and set each of the menu shortcut and it work great(it work for the whole form and this is the way i want it) but the shorcut is limited. I can't use the Escape key or the Enter Key. how can i make a hotkey method to function just like the menu control does(cover the whole form or maybe within the whole application but not outside the application) and also take other shortcut which the menu control doesn't have? or perhaps you have other great idea on how to solve the problem. Thanks.