private void button2_Click(object sender, EventArgs e) { if (txtAd.Text != "" && txtSoyad.Text != "") { Form2 form2 = new Form2(); SkorYaz skor = new SkorYaz(); skor.oyuncuBilgileri(txtAd.Text, txtSoyad.Text); form2.Show(); } else { MessageBox.Show("Lütfen Ad Soyad Girin!"); } }
private void btnTahmin_Click(object sender, EventArgs e) { secim = (Button)sender; for (int i = 0; i < secilenKelime.Length; i++) { if (secim.Text == harfler[i]) { foreach (TextBox txt in txtList) { txtList[i].Text = secim.Text; } secim.Enabled = false; secim.BackColor = System.Drawing.Color.Green; bilinenHarfler++; skor += 20; if (skor == secilenKelime.Length * 20) { MessageBox.Show("Tebrikler Oyunu Bitirdiniz!\n" + "Skorunuz kaydedildi: " + skor); skorlar = new SkorYaz(); skorlar.oyuncuSkor(skor); skorlar.skorYaz(); } } } if (secim.BackColor != System.Drawing.Color.Green) { secim.BackColor = System.Drawing.Color.Red; secim.Enabled = false; kalanHak--; label1.Text = kalanHak.ToString(); if (kalanHak == 0) { MessageBox.Show("Oyunu Kaybettiniz\n" + "Skorunuz Kaydedildi: " + skor); skorlar = new SkorYaz(); skorlar.skorYaz(); this.Close(); } } }