private void FrmLogin_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { Btn_Login.PerformClick(); } }
private void textBox2_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) { Btn_Login.PerformClick(); } }
private void txt_Password_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == Convert.ToChar(Keys.Enter)) { Btn_Login.PerformClick(); } }
private void LoginForm_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Enter: Btn_Login.PerformClick(); break; } }
private void Tbx_Pass_KeyPress(object sender, KeyPressEventArgs e) { // 'e' almacena la tecla presionada if (e.KeyChar == (char)13) //si la tecla pesionada es igual a ENTER (13) { e.Handled = true; //.Handled significa que nosotros nos haremos cargo del codigo //al ser true, evita que apareca la tecla presionada Btn_Login.PerformClick(); } }