Kodları:
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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
double x, y, z;
double secim;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (checkBox1.Checked == true)
{
textBox4.Text = textBox1.Text + "" + textBox4.Text;
}
if (checkBox1.Checked == true && checkBox2.Checked == true)
{
secim = (x + y) / 2;
textBox4.Text = Convert.ToString(secim);
}
if (checkBox1.Checked == true && checkBox2.Checked == true)
{
secim = (x + y + z) / 3;
textBox4.Text = Convert.ToString(secim);
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
x = Convert.ToInt16(textBox1.Text);
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
y = Convert.ToInt16(textBox2.Text);
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
z = Convert.ToInt16(textBox3.Text);
}
}
}
Hazırlayan: Adil AYGÜN
Hiç yorum yok:
Yorum Gönder