ErrorProvider ep = new ErrorProvider(); private void txtKullanici_Validating(object sender, CancelEventArgs e) { if (txtKullanici.Text == "") { e.Cancel = true; ep.SetError(txtKullanici, "Harf giriniz"); } else { ep.SetError(txtKullanici, ""); } } private void txtKullanici_KeyPress(object sender, KeyPressEventArgs e) { char ch = e.KeyChar; if (char.IsNumber(ch)) { ep.SetError(txtKullanici, "Sadece alfabetik karakter giriniz"); } } private void txtSifre_Validating(object sender, CancelEventArgs e) { string password = txtSifre.Text; if (password.Length < 3 || password.Length > 8) { ep.SetError(txtSifre, "Karakter Sayısı 3 veya 8 arasında olmalıdır"); } if (txtSifre.Text == "") { ep.SetError(txtSifre, "Boş bırakılmamalı"); } } private void txtSifreTekrar_Validating(object sender, CancelEventArgs e) { if (txtSifre != txtSifreTekrar) { ep.SetError(txtSifreTekrar, "Girilen Şifre İle Aynı değil"); } if (txtSifreTekrar.Text == "") { ep.SetError(txtSifreTekrar, "Boş bırakılmamalı"); } } private void txtEposta_Validating(object sender, CancelEventArgs e) { string eposta = txtEposta.Text; if (!eposta.Contains("@")) { ep.SetError(txtEposta, "Hatalı Eposta"); } } private void Form2_Load(object sender, EventArgs e) { Random rastgele = new Random(); string sayi = "1234567890"; string uret = ""; for (int i = 0; i < 4; i++) { uret += sayi[rastgele.Next(sayi.Length)]; } label6.Text = uret; } private void txtEposta_TextChanged(object sender, EventArgs e) { } private void btnError_Click(object sender, EventArgs e) { ep.Clear(); } private void btnRemove_Click(object sender, EventArgs e) { txtEposta.Clear(); txtSifre.Clear(); txtSifreTekrar.Clear(); txtGuvenlik.Clear(); txtKullanici.Clear(); } private void btnYolla_Click(object sender, EventArgs e) { Form1 form1 = new Form1(); } private void txtGuvenlik_Validating(object sender, CancelEventArgs e) { } } }