示例#1
0
文件: Form1.cs 项目: lexli88/180226-
 private void UserValidateControl1_UserLoginValidating(object sender, MyEventargs e)
 {
     if (e.LoginId == "admin" && e.LoginPwd == "888888")
     {
         e.IsSuccess = true;
     }
 }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            MyEventargs eventArgs = new MyEventargs();

            eventArgs.LoginId   = UserId.Text.Trim();
            eventArgs.LoginPwd  = UserPwd.Text;
            eventArgs.IsSuccess = false;

            UserLoginValidating(this, eventArgs);
            if (eventArgs.IsSuccess)
            {
                UserId.BackColor  = Color.Green;
                UserPwd.BackColor = Color.Green;
            }
            else
            {
                UserId.BackColor  = Color.Red;
                UserPwd.BackColor = Color.Red;
            }
        }