private void dateTimePicker1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { ProductIdtxt.Focus(); } }
private void ClearControl() { ProductIdtxt.Clear(); Productnametxt.Clear(); comboBoxproduct.SelectedIndex = -1; Addprobtn.Text = "Add"; ProductIdtxt.Focus(); }
private void ProductIdtxt_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (ProductIdtxt.Text.Length > 0) { Productnametxt.Focus(); } else { ProductIdtxt.Focus(); } } }
private bool IsValid() { if (ProductIdtxt.Text.Trim() == string.Empty) { MessageBox.Show("Inter Product ID", "Form validation Error", MessageBoxButtons.OK, MessageBoxIcon.Error); ProductIdtxt.Focus(); return(false); } if (Productnametxt.Text.Trim() == string.Empty) { MessageBox.Show("Inter Product", "Form validation Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Productnametxt.Focus(); return(false); } return(true); }