private void UserValidateControl1_UserLoginValidating(object sender, MyEventargs e) { if (e.LoginId == "admin" && e.LoginPwd == "888888") { e.IsSuccess = true; } }
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; } }