Exemplo n.º 1
0
 private void textBox2_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode.Equals(Keys.Enter))
     {
         LoginBtn.PerformClick();
     }
 }
Exemplo n.º 2
0
 private void passwordBox_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)13)
     {
         LoginBtn.PerformClick();
     }
 }
Exemplo n.º 3
0
        private void passwordTxtBx_KeyPress(object sender, KeyPressEventArgs e)

        {
            if (e.KeyChar == (char)ConsoleKey.Enter)
            {
                LoginBtn.PerformClick();
            }
        }
Exemplo n.º 4
0
        protected override bool ProcessCmdKey(ref Message message, Keys keys)
        {
            switch (keys)
            {
            case Keys.Return:
                //Process action here.
                LoginBtn.PerformClick();
                break;

            case Keys.Escape:
                //Process action here.
                this.Close();
                break;
            }
            return(false);
        }
Exemplo n.º 5
0
 // Check username and password fields.
 private void PasswordTF_TextChanged(object sender, EventArgs e)
 {
     if (KeyChar == (char)13)
     {
         LoginBtn.PerformClick();
     }
     // Only enable login button when both fields have text in them.
     if (String.IsNullOrWhiteSpace(PasswordTF.Text))
     {
         LoginBtn.Enabled = false;
     }
     else
     {
         LoginBtn.Enabled = true;
     }
 }