V Vinodh Dec 29, 2003 #1 In vb.net, I am not able to trap the enter key neither in keypress nor in keydown event
J Jan Tielens Dec 29, 2003 #2 Override the method ProcessKeyPreview in your DataGrid. protected override bool ProcessKeyPreview(ref System.Windows.Forms.Message m) { Keys keyCode = (Keys)(int)m.WParam & Keys.KeyCode; if((m.Msg == WM_KEYDOWN || m.Msg == WM_KEYUP) && keyCode == Keys.Enter ) //Do Stuff return false; return true; } http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q791q
Override the method ProcessKeyPreview in your DataGrid. protected override bool ProcessKeyPreview(ref System.Windows.Forms.Message m) { Keys keyCode = (Keys)(int)m.WParam & Keys.KeyCode; if((m.Msg == WM_KEYDOWN || m.Msg == WM_KEYUP) && keyCode == Keys.Enter ) //Do Stuff return false; return true; } http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q791q