private void MtxtEmail_Leave(object sender, EventArgs e) { if (!Utilidades.IsValidEmail(MtxtEmail.Text)) { Mensajes.Info("El correo no es válido"); MtxtEmail.Focus(); } }
private void MtxtEmail_Validating(object sender, CancelEventArgs e) { if (!RegularExpression.EmailValidation(MtxtEmail.Text.ToString())) { var message = MessageBox.Show("Please enter a valid Email Address", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); if (message == DialogResult.Retry) { MtxtEmail.SelectAll(); e.Cancel = true; } } }