[code language=”CSharp”]
Programda 10 tane Eser bulunmaktadır.Eser isimleri Labeller ile yazılmıştır.
Labellerin karşısında da 10 tane textbox bulunmaktadır.Form ilk açıldığında textler pasif haldedir.
Başla butonuna bastığımız zaman bütün textler aktif olmaktadır.10 tane text koymuştuk.
Bu textlerin yanınada 10 tane buton koyduk.
Örneğin :Textbox1 in içine Yazarın adını yazdık ve Yanındaki Tahmin Et butonuna tıkladığımız zaman eğer Textbox1 in içine doğru cevabı yazdıysak "Tebrikler Doğru Cevap" şeklinde bir mesaj veriyor ve Textbox1 in içi pasif oluyor.Eğer Textbox1 in içine yazdığımız cevap yanlış ise "Yanlış Cevap Verdiniz Lütfen Tekrar Deneyiniz" şeklinde mesaj vermektedir.
NOT:Textlerin içine cevabı yazarken hepsini büyük yada hepsini küçük veya büyük küçük aynı anda yazmakta bir sakınca yoktur cevabı o şekildede kabul edecektir.Fakat arada boşluk bırakılmazsa ,cevabı yanlış olarak kabul edecektir.
Örnek:REŞAT NURİ GÜNTEKİN , reşat nuri güntekin ,Reşat Nuri Güntekin şeklinde yazıldığında cevabı doğru kabul edecektir.Ama reşatnurigüntekin yazıldığında cevabı yanlış kabul edicektir.
NOT:Textlere sadece yazı yazılabilir.[/code]
[code language=”VB.NET”]
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
textBox1.Enabled = false;
textBox2.Enabled = false;
textBox3.Enabled = false;
textBox4.Enabled = false;
textBox5.Enabled = false;
textBox6.Enabled = false;
textBox7.Enabled = false;
textBox8.Enabled = false;
textBox9.Enabled = false;
textBox10.Enabled = false;
}
private void label7_Click(object sender, EventArgs e)
{
}
private void label9_Click(object sender, EventArgs e)
{
}
private void label4_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text.ToUpper() == "TOLSTOY")
{
MessageBox.Show("Tebrikler Doğru Cevap");
textBox1.Enabled = false;
}
else
MessageBox.Show("Yanlış Cevap Verdiniz Lütfen Tekrar Deneyin");
}
private void button2_Click_1(object sender, EventArgs e)
{
if (textBox2.Text.ToUpper() == "HALİT ZİYA UŞAKLIGİL")
{
MessageBox.Show("Tebrikler Doğru Cevap");
textBox2.Enabled = false;
}
else
MessageBox.Show("Yanlış Cevap Verdiniz Lütfen Tekrar Deneyin");
}
private void button3_Click_1(object sender, EventArgs e)
{
if (textBox3.Text.ToUpper() == "REŞAT NURİ GÜNTEKİN")
{
MessageBox.Show("Tebrikler Doğru Cevap");
textBox3.Enabled = false;
}
else
MessageBox.Show("Yanlış Cevap Verdiniz Lütfen Tekrar Deneyin");
}
private void button4_Click(object sender, EventArgs e)
{
if (textBox4.Text.ToUpper() == "MEHMET RAUF")
{
MessageBox.Show("Tebrikler Doğru Cevap");
textBox4.Enabled = false;
}
else
MessageBox.Show("Yanlış Cevap Verdiniz Lütfen Tekrar Deneyin");
}
private void button5_Click(object sender, EventArgs e)
{
if (textBox5.Text.ToUpper() == "PEYAMİ SAFA")
{
MessageBox.Show("Tebrikler Doğru Cevap");
textBox5.Enabled = false;
}
else
MessageBox.Show("Yanlış Cevap Verdiniz Lütfen Tekrar Deneyin");
}
private void button6_Click(object sender, EventArgs e)
{
if (textBox6.Text.ToUpper() == "HALİDE EDİP ADIVAR")
{
MessageBox.Show("Tebrikler Doğru Cevap");
textBox6.Enabled = false;
}
else
MessageBox.Show("Yanlış Cevap Verdiniz Lütfen Tekrar Deneyin");
}
private void button7_Click(object sender, EventArgs e)
{
if (textBox7.Text.ToUpper() == "YAKUP KADRİ KARAOSMANOĞLU")
{
MessageBox.Show("Tebrikler Doğru Cevap");
textBox7.Enabled = false;
}
else
MessageBox.Show("Yanlış Cevap Verdiniz Lütfen Tekrar Deneyin");
}
private void button8_Click(object sender, EventArgs e)
{
if (textBox8.Text.ToUpper() == "YAŞAR KEMAL")
{
MessageBox.Show("Tebrikler Doğru Cevap");
textBox8.Enabled = false;
}
else
MessageBox.Show("Yanlış Cevap Verdiniz Lütfen Tekrar Deneyin");
}
private void button9_Click(object sender, EventArgs e)
{
if (textBox9.Text.ToUpper() == "NAMIK KEMAL")
{
MessageBox.Show("Tebrikler Doğru Cevap");
textBox9.Enabled = false;
}
else
MessageBox.Show("Yanlış Cevap Verdiniz Lütfen Tekrar Deneyin");
}
private void button10_Click(object sender, EventArgs e)
{
if (textBox10.Text.ToUpper() == "FARUK NAFİZ ÇAMLIBEL")
{
MessageBox.Show("Tebrikler Doğru Cevap");
textBox10.Enabled = false;
}
else
MessageBox.Show("Yanlış Cevap Verdiniz Lütfen Tekrar Deneyin");
}
private void button11_Click(object sender, EventArgs e)
{
Close();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void button12_Click(object sender, EventArgs e)
{
textBox1.Enabled = true;
textBox2.Enabled = true;
textBox3.Enabled = true;
textBox4.Enabled = true;
textBox5.Enabled = true;
textBox6.Enabled = true;
textBox7.Enabled = true;
textBox8.Enabled = true;
textBox9.Enabled = true;
textBox10.Enabled = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
}
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false &&
char.IsWhiteSpace(e.KeyChar) == false && e.KeyChar != (char)08)
e.Handled = true;
}
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false &&
char.IsWhiteSpace(e.KeyChar) == false && e.KeyChar != (char)08)
e.Handled = true;
}
private void textBox3_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false &&
char.IsWhiteSpace(e.KeyChar) == false && e.KeyChar != (char)08)
e.Handled = true;
}
private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false &&
char.IsWhiteSpace(e.KeyChar) == false && e.KeyChar != (char)08)
e.Handled = true;
}
private void textBox5_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false &&
char.IsWhiteSpace(e.KeyChar) == false && e.KeyChar != (char)08)
e.Handled = true;
}
private void textBox6_TextChanged(object sender, EventArgs e)
{
}
private void textBox6_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false &&
char.IsWhiteSpace(e.KeyChar) == false && e.KeyChar != (char)08)
e.Handled = true;
}
private void textBox7_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false &&
char.IsWhiteSpace(e.KeyChar) == false && e.KeyChar != (char)08)
e.Handled = true;
}
private void textBox8_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false &&
char.IsWhiteSpace(e.KeyChar) == false && e.KeyChar != (char)08)
e.Handled = true;
}
private void textBox9_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false &&
char.IsWhiteSpace(e.KeyChar) == false && e.KeyChar != (char)08)
e.Handled = true;
}
private void textBox10_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false &&
char.IsWhiteSpace(e.KeyChar) == false && e.KeyChar != (char)08)
e.Handled = true;
}
private void button13_Click(object sender, EventArgs e)
{
textBox1.Enabled = true;
textBox2.Enabled = true;
textBox3.Enabled = true;
textBox4.Enabled = true;
textBox5.Enabled = true;
textBox6.Enabled = true;
textBox7.Enabled = true;
textBox8.Enabled = true;
textBox9.Enabled = true;
textBox10.Enabled = true;
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
textBox5.Text = "";
textBox6.Text = "";
textBox7.Text = "";
textBox8.Text = "";
textBox9.Text = "";
textBox10.Text = "";
}
}[/code]
Projeyi İNDİR
