private void txtgrpname_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { Button18.Focus(); } }
private void chkpgroup_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (chkpgroup.Checked == true) { Button18.Focus(); } else { txtgrop.Focus(); } } }
private void txtgrop_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { e.SuppressKeyPress = true; // This will eliminate the beeping bool inList = false; for (int i = 0; i < txtgrop.Items.Count; i++) { s = txtgrop.GetItemText(txtgrop.Items[i]); if (s == txtgrop.Text) { inList = true; txtgrop.Text = s; break; } } if (!inList) { txtgrop.Text = ""; } Button18.Focus(); } }