TEL : +33 (0)9 72 13 15 17
Welcome
Services
Softwares
Competences
Contact
La boutique
Forums
Windows Forms FAQ resources
5. Windows Forms Datagrid
5.34 How can I prevent the Enter key from moving to the next cell when the user is actively editing the cell and presses Enter?
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 )
return false;
return true;
}
online visitor count