简单问题可惜我不会。没有经验~ 就是这样的。你的按钮是submit的就行了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void txtName_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { if (this.txtName.Text.Length ==0 && e.KeyValue ==8) { this.txtName.Focus (); } if(e.KeyValue ==13 && this.txtName.Text.Trim().Length !=0 ) { this.txtPassWord.Focus(); } } private void txtPassWord_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { //如果密码未输入 if (this.txtPassWord.Text.Length ==0 && e.KeyValue ==8) { this.txtName.Focus (); } if(e.KeyValue==13 && this.txtPassWord.Text.Trim().Length !=0 && this.txtName.Text.Trim().Length!=0) { //验证数据库; } }这个代码已经成功的应用项目中 web:直接写该Button的Click事件。Win:Form.AcceptButton 属性获取或设置当用户按 ENTER 键时所单击的窗体上的按钮 帮忙看个小问题! 一个小问题 正则表达式a.*?b的疑问 NET(C#)MSN技术在线交流群今天成立了 请教Winfrom里的DataGridView分页怎么写? 使用ADODB.Connection的时候遇到问题 如何在Listview中输入数据? 在线等待:Image.FromHbitmap()怎么使用? CRC校验改写 C#中数据编程怎么查找到匹配的记录!说说你的看法 求关于限定数字的正则表达式 求教一个winform显示图片的问题
{
if (this.txtName.Text.Length ==0 && e.KeyValue ==8)
{
this.txtName.Focus ();
}
if(e.KeyValue ==13 && this.txtName.Text.Trim().Length !=0 )
{
this.txtPassWord.Focus();
}
} private void txtPassWord_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
//如果密码未输入
if (this.txtPassWord.Text.Length ==0 && e.KeyValue ==8)
{
this.txtName.Focus ();
}
if(e.KeyValue==13 && this.txtPassWord.Text.Trim().Length !=0 && this.txtName.Text.Trim().Length!=0)
{
//验证数据库;
}
}
这个代码已经成功的应用项目中
直接写该Button的Click事件。
Win:
Form.AcceptButton 属性
获取或设置当用户按 ENTER 键时所单击的窗体上的按钮