我正在制作一个登录表单,我想在其中按100键,然后我的登录按钮上会显示一个peroformedClick
,标题为BtnLogin
.
private void txtPassword_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
BtnLogin.PerformClick();
}
}
问题是,当我按100键时,我的密码101(标题为txtPassword
)文本框中的输入丢失.
如何阻止这种情况发生?