PDA

Orijinalini görmek için tıklayınız

eXTReMe Tracker
: C# ta yazılmış hesap makinesi


arcger
05-05-2007, 12:39 PM
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication5
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public double a,b,c,x;
public string islem;
private void tut()
{
a = double.Parse(textBox1.Text);
textBox1.Text = "";
}

private void c_sıfırla_Click(object sender, EventArgs e)
{
this.textBox1.Text = string.Empty;
}

private void button1_Click(object sender, EventArgs e)
{
ActiveForm.Close();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void btn_0_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "0";
}

private void btn_00_Click(object sender, EventArgs e)
{
textBox1.Text =textBox1.Text + "00";
}

private void btn_1_Click(object sender, EventArgs e)
{
textBox1.Text =textBox1.Text + "1";
}


private void btn_2_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "2";
}

private void btn_3_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "3";
}

private void btn_4_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "4";
}

private void btn_5_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "5";
}

private void btn_6_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "6";
}

private void btn_7_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "7";
}

private void btn_8_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + 8;
}

private void btn_9_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + 9;
}

private void btn_esittir_Click(object sender, EventArgs e)
{

b = Double.Parse(textBox1.Text);
textBox1.Text = "";
double c= 0 ;
switch (islem)
{
case "+":
c = a + b;
break;
case "-":
c = a - b;
break;
case "*":
c = a * b;
break;
case "/":
c = a /b;
break;
case "usal":
c = Math.Pow(a , b);
break;
case "kokal":
c = Math.Pow(a, (1 / b));
break;
}
textBox1.Text = c.ToString();


}

private void btn_topla_Click(object sender, EventArgs e)
{
tut();
islem = "+";

}

private void btn_cikar_Click(object sender, EventArgs e)
{
tut();
islem = "-";
}

private void btn_carp_Click(object sender, EventArgs e)
{
tut();
islem = "*";
}

private void btn_bol_Click(object sender, EventArgs e)
{
tut();
islem = "/";
}

private void btn_kokal_Click(object sender, EventArgs e)
{
tut();
islem = "kokal";
}

private void btn_usal_Click(object sender, EventArgs e)
{
tut();
islem = "usal";

}


}

}
bu da kullanıcı arayüzü

Sitedeki Linkleri Sadece Üyelerimiz Görebilir..

CilekesH
05-05-2007, 12:49 PM
aga söleseydin ya bu napılıyo. nereye yapılıo ?

vatansever_92
06-01-2007, 10:19 PM
hangi uzantıda kaydetcez