private void TxtWhere_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { BtnFind.PerformClick(); } }
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { switch (keyData) { case (Keys.Control | Keys.N): { BtnAddNew.PerformClick(); break; } case (Keys.Control | Keys.E): { BtnEdit.PerformClick(); break; } case (Keys.Control | Keys.D): { BtnDelete.PerformClick(); break; } case (Keys.Control | Keys.S): { BtnSave.PerformClick(); break; } case (Keys.Control | Keys.U): { BtnUndo.PerformClick(); break; } case (Keys.Control | Keys.F): { BtnFind.PerformClick(); break; } case (Keys.Control | Keys.R): { BtnReload.PerformClick(); break; } case (Keys.Control | Keys.P): { BtnPrint.PerformClick(); break; } } return(base.ProcessCmdKey(ref msg, keyData)); }