void lbOrderNum_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { this.Close(); } else if (e.KeyCode == Keys.Enter) { if (lbOrderNum.SelectedIndex >= 0) { frmAddOrder fao = new frmAddOrder(ref sEngine, lbOrderNum.Items[lbOrderNum.SelectedIndex].ToString()); fao.ShowDialog(); } else { this.Close(); } } }
public void ClickAddOrder(EmployeeModel curEmployeeModel) { frmAddOrder addOrder = new frmAddOrder(curEmployeeModel.EmployeeID); addOrder.ShowDialog(); }