private void frmStockItemHistory_KeyPress(System.Object eventSender, System.Windows.Forms.KeyPressEventArgs eventArgs) { short KeyAscii = Strings.Asc(eventArgs.KeyChar); switch (KeyAscii) { case System.Windows.Forms.Keys.Escape: KeyAscii = 0; System.Windows.Forms.Application.DoEvents(); adoPrimaryRS.Move(0); cmdClose_Click(cmdClose, new System.EventArgs()); break; } eventArgs.KeyChar = Strings.Chr(KeyAscii); if (KeyAscii == 0) { eventArgs.Handled = true; } }