private void SbLogin_Click(object sender, EventArgs e) { if (!NetConfiguration.PingTest()) { XtraMessageBox.Show("Please connect to internet."); SbLogin.Focus(); return; } SbLogin.Enabled = false; if (IsFormValidated(SbLogin)) { if (BwLogin.IsBusy) { BwLogin.CancelAsync(); } else { BwLogin.RunWorkerAsync(); } PpWait.Show(); } }