using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace BILGISYARISMASI_GUNCEL
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int soruno = 0;
int dogru = 0;
int yanlis =0;
private void button5_Click(object sender, EventArgs e)
{
soruno++;
LblSoruNo.Text = soruno.ToString();
if (soruno == 1)
{
richTextBox1.Text = "Cumhuriyet kaç yılında kurulmuştur";
BtnA.Text = "1924";
BtnB.Text = "1923";
BtnC.Text = "1920";
BtnD.Text = "1922";
label7.Text = "1923";
}
if (soruno == 2)
{
richTextBox1.Text = " Hangi il Ege bölgemizde bulunmaz";
BtnA.Text = "İzmir";
BtnB.Text = "Bursa";
BtnC.Text = "Aydın";
BtnD.Text = "Manisa";
label7.Text = "Bursa";
}
if ( soruno==3)
{
richTextBox1.Text = " Fenerbahçe kaç yılında kurulmuştur";
BtnA.Text= "1903";
BtnB.Text= "1907";
BtnC.Text= "1905";
BtnD.Text = "1908";
label7.Text = "1907";
}
}
private void BtnB_Click(object sender, EventArgs e)
{
label8.Text = BtnB.Text;
if (label8.Text == label7.Text)
{
dogru++;
LblDogru.Text = dogru.ToString();
pictureBox1.Visible = true;
}
else
yanlis++;
LblYanlis1.Text = yanlis.ToString();
pictureBox2.Visible = true;
}
}
}
Arkadaşlar burada yapmak istediğim B buttonuna bastığımda doğru cevap verip, doğru sayımın artması. O oluyor sıkıntı yok.
Ama diğer butonlara tıkladığımda da yanlış sayısı artmıyor.
Bunu sadece diğer buttonlarada if else komutunu eklersem oluyor ama bunun onlar olmadan da yapabilindiğini gördüm öğrendiğim dersten. Ama bende hiçbir değişme olmuyor ve herhangi bir hata da vermiyor.
Anlayan varsa bir yardımcı olabilir mi
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace BILGISYARISMASI_GUNCEL
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int soruno = 0;
int dogru = 0;
int yanlis =0;
private void button5_Click(object sender, EventArgs e)
{
soruno++;
LblSoruNo.Text = soruno.ToString();
if (soruno == 1)
{
richTextBox1.Text = "Cumhuriyet kaç yılında kurulmuştur";
BtnA.Text = "1924";
BtnB.Text = "1923";
BtnC.Text = "1920";
BtnD.Text = "1922";
label7.Text = "1923";
}
if (soruno == 2)
{
richTextBox1.Text = " Hangi il Ege bölgemizde bulunmaz";
BtnA.Text = "İzmir";
BtnB.Text = "Bursa";
BtnC.Text = "Aydın";
BtnD.Text = "Manisa";
label7.Text = "Bursa";
}
if ( soruno==3)
{
richTextBox1.Text = " Fenerbahçe kaç yılında kurulmuştur";
BtnA.Text= "1903";
BtnB.Text= "1907";
BtnC.Text= "1905";
BtnD.Text = "1908";
label7.Text = "1907";
}
}
private void BtnB_Click(object sender, EventArgs e)
{
label8.Text = BtnB.Text;
if (label8.Text == label7.Text)
{
dogru++;
LblDogru.Text = dogru.ToString();
pictureBox1.Visible = true;
}
else
yanlis++;
LblYanlis1.Text = yanlis.ToString();
pictureBox2.Visible = true;
}
}
}
Arkadaşlar burada yapmak istediğim B buttonuna bastığımda doğru cevap verip, doğru sayımın artması. O oluyor sıkıntı yok.
Ama diğer butonlara tıkladığımda da yanlış sayısı artmıyor.
Bunu sadece diğer buttonlarada if else komutunu eklersem oluyor ama bunun onlar olmadan da yapabilindiğini gördüm öğrendiğim dersten. Ama bende hiçbir değişme olmuyor ve herhangi bir hata da vermiyor.
Anlayan varsa bir yardımcı olabilir mi