9 Nisan 2013 Salı
ÖDEVİMİDE KOYDUM
public Form1()
{
InitializeComponent();
textBox2.Visible = false;
button2.Visible = false;
//form 1 açıldığında textbox2 ve botton2 görünmez olucak
//visible false görünmez yapar visible true görünür yapar
}
//___________________ YUKARSI FORM1 BU ŞEKİLDE OLUYOR
//_____________________AŞAĞISI BUTTON1 BU ŞEKİLDE OLUYOR
private void button1_Click(object sender, EventArgs e)
{
string sifre;
sifre = textBox1.Text.ToString();
textBox1.Text = sifre;
textBox1.Visible = false;
button1.Visible = false;
//textbox1 ve button1 ile işimiz bittiği için artık bunları görünmez yapıyoruz
//ve tabiki tetbox2 ve button2 yi tekrar görünür yapıyoruz aşağıda
textBox2.Visible = true;
button2.Visible = true;
MessageBox.Show("Sifre Kaydedildi 2 adıma geçebilirsiniz");
textBox2.Visible = true;
button2.Visible = true;
}
//_________________________AŞAĞISI BUTTON2 BU ŞEKİLDE OLUYOR
private void button2_Click(object sender, EventArgs e)
{
string kontrol;
string sifre2;
int sayac=0;
kontrol = textBox1.Text;
sifre2 = textBox2.Text;
if (kontrol == sifre2)
{
MessageBox.Show("sifre doğru");
}
else
{
sayac++;
MessageBox.Show("yanlış girdiniz");
}
if (sayac == 3)
{
textBox2.Visible = false;
button2.Visible = false;
MessageBox.Show("bloke oldugunuz!!!");
}
}
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder