Exemplo n.º 1
0
 private void btnIniciar_Click(object sender, EventArgs e)
 {
     if (txtID.Text == "LWT" && txtCon.Text == "123")
     {
         //MessageBox.Show("Se ha iniciado sesion...");
         this.Hide();                                //Oculta la ventana de sesion.
         Ventana2 ven = new Ventana2();
         ven.Show();
     }
     else
     {
         MessageBox.Show("Error en el ID o la contraseña... Intente de nuevo...");
         txtID.Text  = string.Empty;
         txtCon.Text = string.Empty;
         txtID.Focus();
     }
 }
Exemplo n.º 2
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (textUser.Text == "AbeQt" && textPassword.Text == "1234")
            {
                MessageBox.Show("Welcome");
                this.Hide();

                Ventana2 nuevaVentana = new Ventana2();
                nuevaVentana.Show();
            }
            else
            {
                MessageBox.Show("Error!");
                textUser.Clear();
                textPassword.Clear();
            }
        }