Ejemplo n.º 1
0
        private void btnLogIn_Click(object sender, EventArgs e)
        {
            string usuario = txtUser.Text;
            string senha   = txtPass.Text;

            if (usuario == "leleo" && senha == "leleo123")
            {
                this.Close();
                frmHome Menu = new frmHome();
                Menu.Show();
                Menu.lblConnectedUser.Text = Strings.ConnectedUser + " Leonardo Nogueira";
            }
            else if (usuario == "jailson" && senha == "jailson123")
            {
                this.Close();
                frmHome Menu = new frmHome();
                Menu.Show();
                Menu.lblConnectedUser.Text = Strings.ConnectedUser + " Jailson Mendes";
            }
            else
            {
                lblErro.Visible       = true;
                pbxBasePass.BackColor = Color.FromArgb(220, 0, 0);
                pbxBaseUser.BackColor = Color.FromArgb(220, 0, 0);
                txtPass.Clear();
                txtPass.UseSystemPasswordChar = false;
                txtPass.ForeColor             = Color.FromArgb(120, 120, 120);
                txtPass.Text = "Password";
                if (txtUser.Text == "Username")
                {
                    txtUser.Focus();
                }
                else
                {
                    txtPass.Focus();
                }
            }
        }