C# 密码框按回车,同时登录按钮回车

        private void txbPassword_KeyPress(object sender, KeyPressEventArgs e)
        {
            //输入密码后按回车键直接登录
            if (e.KeyChar == 13)
            {
                this.btn_Login.Focus();
                this.btn_Login.PerformClick();
            }
        }
原文地址:https://www.cnblogs.com/shawnzhou/p/3089795.html