private void btncustype_Click(object sender, EventArgs e) { var privouscontroal = cmbPosition; activecontroal = privouscontroal.Name; Employeetype popup = new Employeetype(this, tabControl, master, activecontroal); master.AddNewTab(popup); }
private void btncusendit_Click(object sender, EventArgs e) { if (cmbPosition.Text != null && cmbPosition.Text != "") { var privouscontroal = cmbPosition; activecontroal = privouscontroal.Name; Employeetype dlg = new Employeetype(this, tabControl, master, activecontroal); dlg.Update(Convert.ToString(cmbPosition.SelectedValue)); master.AddNewTab(dlg); dlg.Show(); } else { MessageBox.Show("Please Select User/Employee Type", "User/Employee Type", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void cmbPosition_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 < cmbPosition.Items.Count; i++) { s = cmbPosition.GetItemText(cmbPosition.Items[i]); if (s == cmbPosition.Text) { inList = true; cmbPosition.Text = s; break; } } if (!inList) { cmbPosition.Text = ""; } cmbcommtyep.Focus(); } if (e.KeyCode == Keys.F3) { var privouscontroal = cmbPosition; activecontroal = privouscontroal.Name; Employeetype popup = new Employeetype(this, tabControl, master, activecontroal); master.AddNewTab(popup); } if (e.KeyCode == Keys.F2) { var privouscontroal = cmbPosition; activecontroal = privouscontroal.Name; Employeetype dlg = new Employeetype(this, tabControl, master, activecontroal); dlg.Update(Convert.ToString(cmbPosition.SelectedValue)); master.AddNewTab(dlg); // dlg.Show(); } }