void Txt_CodigoKeyPress(object sender, KeyPressEventArgs e)
        {
            //Evento Txt_código do Formulario.

            if (e.KeyChar == 13)                    // 13 == enter
            {
                Calcular();
            }
            else if (e.KeyChar == 27)                    // 27 == Esc
            {
                Frm_Principal principal = new Frm_Principal();

                principal.Show();

                this.Dispose();
            }
        }
Example #2
0
        void Button1Click(object sender, EventArgs e)
        {
            if (Txt_Login.Text == "Admin" && Txt_Senha.Text == "Admin")
            {
                Lbl_Login.Text = "logado!";

                Lbl_Login.ForeColor = Color.Green;


                Frm_Principal principal = new Frm_Principal();

                principal.Show();

                this.Visible = false;
            }
            else
            {
                MessageBox.Show("Erro tente novamente!");

                Lbl_Login.Text = "Erro Login ou Senha Invalidos!";
                Txt_Senha.Clear();
                Txt_Login.Clear();
            }
        }