سفارش تبلیغ
صبا ویژن
هرکس بسیار به درس و مباحثه علم بپردازد، آنچه را فرا گرفته از یاد نبرد وآنچه را ندانسته فرا گیرد . [امام علی علیه السلام]

علمی ،آموزشی،تحقیقاتی

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

namespace WindowsApplication1

{

public partial class Form1 : Form

{

bool key=true ;

byte op;

int num1;

public Form1()

{

InitializeComponent();

}

private void Form1_Load( sender, EventArgs e)

{

}

private void button1_Click( sender, EventArgs e)

{

}

private void button2_Click( sender, EventArgs e)

{

}

private void button1_Click_1( sender, EventArgs e)

{

if (key)

textBox1.Text = textBox1.Text + "1";

else

{

textBox1.Clear();

textBox1.Text = "1";

key = true;

}

}

private void button13_Click( sender, EventArgs e)

{

key = false;

op = 1;

num1 = Convert.ToInt16(textBox1.Text);

}

private void button12_Click( sender, EventArgs e)

{

int num3;

int num2 = Convert.ToInt16 (textBox1.Text);

switch (op)

{

case 1:

num3=num1+num2;

textBox1.Text = num3.ToString();

break;

case 2:

num3 = num1 - num2;

textBox1.Text = num3.ToString();

break;

case 3:

num3 = num1 * num2;

textBox1.Text = num3.ToString();

break;

case 4:

num3 = num1 / num2;

textBox1.Text = num3.ToString();

break;

}

}

private void button2_Click_1( sender, EventArgs e)

{

if (key)

textBox1.Text = textBox1.Text + "2";

else

{

textBox1.Clear();

textBox1.Text = "2";

key = true;

}

}

private void button3_Click( sender, EventArgs e)

{

if (key)

textBox1.Text = textBox1.Text + "3";

else

{

textBox1.Clear();

textBox1.Text = "3";

key = true;

}

}

private void button4_Click( sender, EventArgs e)

{

if (key)

textBox1.Text = textBox1.Text + "4";

else

{

textBox1.Clear();

textBox1.Text = "4";

key = true;

}

}

private void button5_Click( sender, EventArgs e)

{

if (key)

textBox1.Text = textBox1.Text + "5";

else

{

textBox1.Clear();

textBox1.Text = "5";

key = true;

}

}

private void button6_Click( sender, EventArgs e)

{

if (key)

textBox1.Text = textBox1.Text + "6";

else

{

textBox1.Clear();

textBox1.Text = "6";

key = true;

}

}

private void button7_Click( sender, EventArgs e)

{

if (key)

textBox1.Text = textBox1.Text + "7";

else

{

textBox1.Clear();

textBox1.Text = "7";

key = true;

}

}

private void button8_Click( sender, EventArgs e)

{

if (key)

textBox1.Text = textBox1.Text + "8";

else

{

textBox1.Clear();

textBox1.Text = "8";

key = true;

}

}

private void button9_Click( sender, EventArgs e)

{

if (key)

textBox1.Text = textBox1.Text + "9";

else

{

textBox1.Clear();

textBox1.Text = "9";

key = true;

}

}

private void button10_Click( sender, EventArgs e)

{

if (key)

textBox1.Text = textBox1.Text + "0";

else

{

textBox1.Clear();

textBox1.Text = "0";

key = true;

}

}

private void button14_Click( sender, EventArgs e)

{

key = false;

op = 2;

num1 = Convert.ToInt16(textBox1.Text);

}

private void button15_Click( sender, EventArgs e)

{

key = false;

op = 3;

num1 = Convert.ToInt16(textBox1.Text);

}

private void button16_Click( sender, EventArgs e)

{

key = false;

op = 4;

num1 = Convert.ToInt16(textBox1.Text);

}

}

}




مژده فرجی ::: یکشنبه 87/9/3::: ساعت 12:46 عصر

>> بازدیدهای وبلاگ <<
بازدید امروز: 5


بازدید دیروز: 35


کل بازدید :59543
 
 >>اوقات شرعی <<
 
>> درباره خودم<<
مدیر وبلاگ : مژده فرجی[85]
نویسندگان وبلاگ :
سمانه طالبی (@)[0]

مژده فرجی (@)[0]


 
 
>>موسیقی وبلاگ<<
 
>>اشتراک در خبرنامه<<
 
 
>>طراح قالب<<