private void btnLogin_Click(object sender, EventArgs e) { account.Name = txtUserName.Text.Trim(); account.Password = txtUserPwd.Text.Trim(); if (aUI.IsValid()) { LockControl(); backgroundWorker.RunWorkerAsync(); } else { ShowLoginNotValid(); } }