private void EmailTextbox_TextChanged(object sender, EventArgs e) { //checks if the email is in correct form EmailValidation EValidation = new EmailValidation(); IsValid = EValidation.IsValidEmail(EmailTextbox.Text); //changes color to red if the email given is in wrong format if (IsValid) { EmailTextbox.ForeColor = Color.Black; } else { EmailTextbox.ForeColor = Color.Red; } if ((EmailTextbox.Text == "") || (EmailTextbox.Text == "Πληκτρολογίστε ΕΔΩ το email του παραλήπτη") || !(IsValid)) { SendButton.Enabled = false; SendButton.BackColor = Color.LightGray; } else { SendButton.Enabled = true; SendButton.BackColor = Color.LightBlue; } }
private void EmailTextbox_TextChanged(object sender, EventArgs e) { //checks if the email is in correct form EmailValidation EValidation = new EmailValidation(); IsValid = EValidation.IsValidEmail(EmailTextbox.Text); //changes color to red if the email given is in wrong format if (IsValid) { EmailTextbox.ForeColor = System.Drawing.Color.Black; } else { EmailTextbox.ForeColor = System.Drawing.Color.Red; } FilledTextboxes(); }