private void pictureBox1_Click(object sender, EventArgs e) { PanelWindow child = new PanelWindow(); ActiveForm.Hide(); child.Show(); }
private void button1_Click(object sender, EventArgs e) { try { string user = comboBoxHomeUserNames.SelectedItem.ToString(); string arrayUser; for (int i = 0; i < array.Count; i++) { if ((arrayUser = array[i].getUserName()).Equals(user)) { if (textBoxHomePassword.Text == array[i].getPassword()) { PanelWindow.PopDISP(i, array[i].getName(), array[i].getLastName(), array[i].getUserName(), array[i].getTypeUser()); PanelWindow child1 = new PanelWindow(); ActiveForm.Hide(); child1.Show(); } else { MessageBox.Show("Invalid Password", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBoxHomePassword.Text = ""; } } } } catch (Exception) { MessageBox.Show("Please select a user to proceed", "Request", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }