} // PW 텍박 벗어날 시 private void PW_txt_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { Login_btn.PerformClick(); } }
private void Password_txtbx_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) { Login_btn.PerformClick(); } }
/// <summary> /// /// </summary> /// <param name="msg"></param> /// <param name="keyData"></param> /// <returns></returns> protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == (Keys.Enter)) { if (this.ActiveControl == LoginName_txt) { Password_txt.Focus(); return(true); } else if (this.ActiveControl == Password_txt) { Login_btn.PerformClick(); return(true); } } return(base.ProcessCmdKey(ref msg, keyData)); }