private void Validation() { System.ComponentModel.CancelEventArgs e = new System.ComponentModel.CancelEventArgs(); string pattern = "^[ABCEGHJ-NPRSTVXY]{1}[0-9]{1}[ABCEGHJ-NPRSTV-Z]{1}[ ]?[0-9]{1}[ABCEGHJ-NPRSTV-Z]{1}[0-9]{1}$"; Regex reg = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); GetValue(); if (String.IsNullOrWhiteSpace(firstNameTxt.Text) || FirstName.Any(c => Char.IsNumber(c))) { MessageBox.Show("Please enter your First Name"); firstNameTxt.Focus(); e.Cancel = true; } else if (String.IsNullOrWhiteSpace(Lastname) || Lastname.Any(c => Char.IsNumber(c))) { MessageBox.Show("Please enter your Last Name"); lastNameTxt.Focus(); e.Cancel = true; } else if (String.IsNullOrWhiteSpace(Address)) { MessageBox.Show("Please enter your Address"); addressTxt.Focus(); e.Cancel = true; } else if (String.IsNullOrWhiteSpace(City) || City.Any(c => Char.IsNumber(c))) { MessageBox.Show("Please enter your City"); cityTxt.Focus(); e.Cancel = true; } else if ((String.IsNullOrWhiteSpace(PostalCode)) || (reg.IsMatch(PostalCode)) == false) { MessageBox.Show("Please enter your Postal code"); postalCodeTxt.Focus(); e.Cancel = true; } else if (String.IsNullOrWhiteSpace(Month)) { MessageBox.Show("Please select a month"); mntCmb.Focus(); e.Cancel = true; } else if (String.IsNullOrWhiteSpace(Years)) { MessageBox.Show("Please select a Year"); yrCombo.Focus(); e.Cancel = true; } else if (String.IsNullOrWhiteSpace(CurrentDay)) { MessageBox.Show("Please select a Day"); dayCmb.Focus(); e.Cancel = true; } else if (String.IsNullOrWhiteSpace(Province)) { MessageBox.Show("Please select a Province"); provinceCmb.Focus(); e.Cancel = true; } else if (String.IsNullOrWhiteSpace(Trainer)) { MessageBox.Show("Please select a Trainer"); trainercmb.Focus(); e.Cancel = true; } else if (String.IsNullOrEmpty(Experienced) && String.IsNullOrEmpty(Experienced) && String.IsNullOrEmpty(Beginer)) { MessageBox.Show("Please select a Program Level"); experienceRadio.Focus(); e.Cancel = true; } else if (String.IsNullOrEmpty(BankAccount) && String.IsNullOrEmpty(Annual) && String.IsNullOrEmpty(Monthly)) { MessageBox.Show("Please select a Billing Info"); bankChk.Focus(); e.Cancel = true; } else { validate = true; } }