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 WindowsFormsApplication2
{
public partial class Form1 : Form
{
int z;
float e;
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void label3_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if (label2.Text == "".ToString())
{
float a = float.Parse(textBox1.Text);
label3.Text = a.ToString();
textBox1.Text = "".ToString();
z = 1;
}
else
{
float r = float.Parse(label2.Text);
label3.Text = r.ToString();
z = 1;
}
}
private void button2_Click_1(object sender, EventArgs e)
{
if (label2.Text == "".ToString())
{
float a = float.Parse(textBox1.Text);
label3.Text = a.ToString();
textBox1.Text = "".ToString();
z = 2;
}
else
{
float r = float.Parse(label2.Text);
label3.Text = r.ToString();
z = 2;
}
}
private void button3_Click_1(object sender, EventArgs e)
{
if (label2.Text == "".ToString())
{
float a = float.Parse(textBox1.Text);
label3.Text = a.ToString();
textBox1.Text = "".ToString();
z = 3;
}
else
{
float r = float.Parse(label2.Text);
label3.Text = r.ToString();
z = 3;
}
}
private void button4_Click_1(object sender, EventArgs e)
{
if (label2.Text == "".ToString())
{
float a = float.Parse(textBox1.Text);
label3.Text = a.ToString();
textBox1.Text = "".ToString();
z = 4;
}
else
{
float r = float.Parse(label2.Text);
label3.Text = r.ToString();
z = 4;
}
}
private void label3_Click_1(object sender, EventArgs e)
{
}
private void button5_Click(object sender, EventArgs e)
{
float q = float.Parse(label3.Text),w = float.Parse(textBox1.Text);
if (z==1)
{
label2.Text = (q + w).ToString();
}
if (z == 2)
{
label2.Text = (q - w).ToString();
}
if (z == 3)
{
label2.Text = (q * w).ToString();
}
if (z == 4)
{
label2.Text = (q / w).ToString();
}
textBox1.Text = "".ToString();
label3.Text = "".ToString();
//float r = float.Parse(label2.Text);
//label3.Text = r.ToString();
}
private void button6_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "0";
}
private void button7_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "1";
}
private void button8_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "2";
}
private void button9_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "3";
}
private void button10_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "4";
}
private void button11_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "5";
}
private void button12_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "6";
}
private void button13_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "7";
}
private void button14_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "8";
}
private void button15_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + "9";
}
private void button16_Click(object sender, EventArgs e)
{
textBox1.Text = "";
label2.Text = "";
}
private void button17_Click(object sender, EventArgs e)
{
if (label2.Text == "".ToString())
{
float a = float.Parse(textBox1.Text);
textBox1.Text = (1 / a).ToString();
}
else
{
float a = float.Parse(label2.Text);
label2.Text = (1 / a).ToString();
}
}
}
}