private void pictureBox_add_candidat_save_Click(object sender, EventArgs e) { add_candidat_procedure(); Regex regex = new Regex(@"[\w-]+@([\w-]+\.)+[\w-]+"); Match match = regex.Match(metroTextBox_add_candidat_email.Text); if (match.Success) { //code here email is valid do the work here //MessageBox.Show("Okay"); Class_Database_app.add_new_candidat(); } else { //code here erreur email not valid MessageBox.Show("L’email du candidat doit être en le format standard", "Les Règles De Gestion", MessageBoxButtons.OK, MessageBoxIcon.Warning); } Program.new_candidat_to_add = new Class_Candidat(); reset_form_adding(); }