回车键触发登录按钮 [英] Enter key triggering the Login button

查看:283
本文介绍了回车键触发登录按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的登录表单有4个控制。用户可以输入名称,密码和按键输入登录。

My login form has 4 controls. The user can input name, password and enter on button for login.

我想回车键触发名和密码文本框后登录动作都填写

I'd like the Enter key to trigger the Login action after the Name and Password textboxes are filled out.

如何才能做到这一点?试图避免 btnLogin.Focus()文本框事件在

How can this be done? Trying to avoid btnLogin.Focus() under the TextBox event.

推荐答案

在表单中可以设置的AcceptButton财产登录按钮。

On your form you can set the AcceptButton property to the login button.

这篇关于回车键触发登录按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆