private void txtPayAmnt_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (cmbPayMode.SelectedIndex == 0) { MessageBox.Show("Please Select the PayMode..", "Restaurant", MessageBoxButtons.OK, MessageBoxIcon.Warning); cmbPayMode.Focus(); if (cmbPayMode.Focus()) { cmbPayMode.FlatStyle = FlatStyle.Popup; cmbPayMode.BackColor = System.Drawing.Color.Brown; cmbPayMode.ForeColor = System.Drawing.Color.White; } } else if (cmbPayMode.SelectedIndex != 1) { txtCredChq.Focus(); } else { int j = dgvPayDetails.CurrentRow.Index; dgvPayDetails.Rows[j].Cells[0].Value = cmbPayMode.Text; dgvPayDetails.Rows[j].Cells[1].Value = txtPayAmnt.Text; dgvPayDetails.Rows[j].Cells[2].Value = txtCredChq.Text; dgvPayDetails.Rows[j].Cells[3].Value = dtpPayDt.Text; dgvPayDetails.Rows.Add(); dgvPayDetails.CurrentCell = dgvPayDetails.Rows[j + 1].Cells[0]; cmbPayMode.SelectedIndex = 0; txtPayAmnt.Text = ""; txtCredChq.Text = ""; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)