467,151 Members | 923 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,151 developers. It's quick & easy.

Not working shortcut key when Datagrid has focus

hi
I am working on window appication.
and i have put a shortcut key for different action like say F1 is press then new record etc like that

now when i have focus in datagrid i am getting keydown when working in datagrid cell so i am not getting which key is pressed and am not able to make my shortcut working.
plz give me some solution
Nov 23 '06 #1
  • viewed: 1442
Share:
2 Replies
sivadhas2006
100+
Hi,

Can you post your code?

Check the Form Design Time KeyPreview Property.

Regards,
M.Sivadhas.
Nov 23 '06 #2
Hi,

Can you post your code?

Check the Form Design Time KeyPreview Property.

Regards,
M.Sivadhas.
Here is code for u.
In the forms load event i added hanler for handling keydown event
AddHandler CType(dgcharge.TableStyles(0).GridColumnStyles(1), DataGridTextBoxColumn).TextBox.KeyDown, AddressOf txtChargecode_KeyDown


And here is my key down event
Select Case e.KeyCode
Case Keys.F1
cmdnew_Click(cmdnew, e)
Case Keys.F2
cmdmodf_Click(cmdmodf, e)
Case Keys.F3
cmdsave_Click(cmdsave, e)
Case Keys.F4
cmdcancl_Click(cmdcancl, e)
Case Keys.F5
cmdDelete_Click(cmdDelete, e)
Case Keys.F12
cmdexit_Click(cmdexit, e)
End Select
Nov 25 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Matthew | last post: by
reply views Thread by Saper\(ek\) | last post: by
reply views Thread by Marcel | last post: by
1 post views Thread by Gidi | last post: by
7 posts views Thread by marty.overdear@intergraph.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.