public Form1() { InitializeComponent(); SidePanel.Height = button1.Height; SidePanel.Top = button1.Top; SidePanel.BringToFront(); login2.BringToFront(); textUsername.BringToFront(); textPasswors.BringToFront(); btnIniciaSesion.BringToFront(); alert.BringToFront(); alert.Hide(); Alert3.Hide(); }
private void button14_Click(object sender, EventArgs e) { if (!allowed) { alert.Hide(); alert2.Hide(); Alert3.BringToFront(); Alert3.Show(); } else { alert.Hide(); alert2.Hide(); Alert3.Hide(); integrantesCustomControl11.BringToFront(); SidePanel.Hide(); } }
private void Login(string username, string password) { for (int i = 0; i < user.Length; i++) { if (user[i].Contains(username) && contra[i].Contains(password)) { alert.Hide(); Alert3.Hide(); alert2.Hide(); allowed = true; firstCustomControl2.BringToFront(); } else { alert.BringToFront(); alert.Show(); } } }
private void button2_Click(object sender, EventArgs e) { if (!allowed) { alert.Hide(); alert2.Hide(); Alert3.BringToFront(); Alert3.Show(); } else { alert.Hide(); alert2.Hide(); Alert3.Hide(); SidePanel.Show(); SidePanel.Height = button2.Height; SidePanel.Top = button2.Top; mySecondCustmControl11.BringToFront(); } }
//Checkeando si se puede traer al frente los demas componentes private void button1_Click(object sender, EventArgs e) { if (!allowed) { alert.Hide(); alert2.Hide(); Alert3.BringToFront(); Alert3.Show(); } else { alert.Hide(); alert2.Hide(); Alert3.Hide(); SidePanel.Show(); SidePanel.Height = button1.Height; SidePanel.Top = button1.Top; firstCustomControl2.BringToFront(); } }
//Evento de click al boton de inicio de sesion private void btnIniciaSesion_Click(object sender, EventArgs e) { string username = textUsername.Text.Trim(); string password = textPasswors.Text.Trim(); bool emptyTextBoxes = CheckIfEmpty(username, password); if (emptyTextBoxes) { alert.Hide(); Alert3.Hide(); alert2.BringToFront(); alert2.Show(); } else { alert.Hide(); alert2.Hide(); Alert3.Hide(); Login(username, password); } }