Formun Tamamı İçin Tıklayınız.
EMİR ÖZBEY
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string ad;
int p = 0;
int h = 20;
double m, q, w, f, ı, g, d,o;
double sonuc = 0;
int v=0;
void mesaj()
{
if (sonuc == Convert.ToInt32(textBox3.Text))
{
p = p + 10;
label3.Text = p.ToString();
listBox1.Items.Add(++v + ")" + sonuc + " " + "Doğru" + " " + textBox3.Text + " " + "Doğru");
}
else
{
p = p - 10;
label3.Text = p.ToString();
listBox1.Items.Add(++v + ")" + sonuc + " " + "Doğru" + " " + textBox3.Text + " " + "Yanlış");
}
}
private void button1_Click(object sender, EventArgs e)
{
m = Convert.ToInt32(textBox1.Text);
q = Convert.ToInt32(textBox2.Text);
sonuc = m + q;
mesaj();
listBox1.BackColor = Color.Red;
}
private void button5_Click(object sender, EventArgs e)
{
Random a=new Random();
int k = a.Next(1, 25);
int k1 = a.Next(1, 25);
textBox1.Text=k.ToString();
textBox2.Text = k1.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
w = Convert.ToInt32(textBox1.Text);
f = Convert.ToInt32(textBox2.Text);
sonuc = w - f;
mesaj();
listBox1.BackColor = Color.Yellow;
}
private void button3_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
ı = Convert.ToInt32(textBox1.Text);
o = Convert.ToInt32(textBox2.Text);
sonuc =(ı / o);
mesaj();
listBox1.BackColor = Color.Blue;
}
private void button4_Click(object sender, EventArgs e)
{
g = Convert.ToInt32(textBox1.Text);
d = Convert.ToInt32(textBox2.Text);
sonuc = g * d;
mesaj();
listBox1.BackColor = Color.Green;
}
private void timer1_Tick(object sender, EventArgs e)
{
h = h - 1;
label2.Visible = true;
label2.Text = h.ToString();
if(h==0)
{
panel1.Visible = false;
label1.Enabled = false;
label2.Enabled = false;
label3.Enabled = false;
listBox1.Enabled = false;
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = false;
button4.Enabled = false;
textBox1.Enabled= false;
textBox2.Enabled = false;
textBox3.Enabled = false;
listBox1.Items.Add(ad+" "+"Puanınız"+" "+p);
listBox2.Items.Add(ad + " " + "Puanınız" + " " + p);
timer1.Stop();
label2.Visible = false;
}
}
private void Form1_Load(object sender, EventArgs e)
{
label3.Text = p.ToString();
}
private void button6_Click(object sender, EventArgs e)
{
label1.Enabled = false;
label2.Enabled = false;
label3.Enabled = false;
listBox1.Enabled = false;
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = false;
button4.Enabled = false;
textBox1.Enabled = false;
textBox2.Enabled = false;
textBox3.Enabled = false;
textBox3.Clear();
textBox4.Clear();
p = 0;
listBox1.Items.Clear();
h = 20;
timer1.Start();
ad = textBox4.Text;
panel1.Visible = true;
}
private void button7_Click(object sender, EventArgs e)
{
listBox1.Visible = true;
}
}
}
Hiç yorum yok:
Yorum Gönder