کد:
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button5_Click(object sender, EventArgs e)
{
Close();
}
private void button6_Click(object sender, EventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
}
private void button1_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
int y = int.Parse(textBox2.Text);
int s = x + y;
textBox3.Text = s.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
int y = int.Parse(textBox2.Text);
int s = x - y;
textBox3.Text = s.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
int y = int.Parse(textBox2.Text);
int s = x * y;
textBox3.Text = s.ToString();
}
private void button4_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
int y = int.Parse(textBox2.Text);
int s = x / y;
textBox3.Text = s.ToString();
}
}
}
+++++++++++++++
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button5_Click(object sender, EventArgs e)
{
Close();
}
private void button6_Click(object sender, EventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
}
private void button1_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
int y = int.Parse(textBox2.Text);
int s = x + y;
textBox3.Text = s.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
int y = int.Parse(textBox2.Text);
int s = x - y;
textBox3.Text = s.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
int y = int.Parse(textBox2.Text);
int s = x * y;
textBox3.Text = s.ToString();
}
private void button4_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
int y = int.Parse(textBox2.Text);
int s = x / y;
textBox3.Text = s.ToString();
}
private void button7_Click(object sender, EventArgs e)
{
}
private void button8_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
textBox1.Text = s.ToString();
}
private void button9_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
textBox1.Text = s.ToString();
}
private void button10_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
textBox1.Text = S.ToString();
}
private void button11_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
textBox1.Text = S.ToString();
}
private void button12_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
textBox1.Text = S.ToString();
}
private void button14_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
textBox1.Text = S.ToString();
}
private void button13_Click(object sender, EventArgs e)
{
int x = int.Parse(textBox1.Text);
textBox1.Text = s.ToString();
}
}
}
سلام دوستان اين برنامه کد يه ماشين حسابه.من براي */-+ کد ها رو نوشتم ولي براي برنامه بعدي که شامل sin/cos/tan/cot/sgrt/توان/لوگاريتم
گويا بايد تابع خاصي که مربوط به سينوس و .... هست فراخواني بشه
و برنامه بعدي کاملا يک ماشين حساب شبيه به ماشين حساب ويندوز باشه فقط مي خوام بدونم که وقتي دکمه مثلا عدد يک رو ايجاد کرديم براي اينکه مقدار 1 رو توي خودش ذخيره کنه چي بايد بنويسم.
و برنامه بعدي اينه که يه فرم معمولي ايجاد کنيم که به مرور کم رنگ و کم رنگ و بعد دوباره به حالت اولش برگرده(بوسيله خاصيتopacity
ممنون ميشم کمکم کنيد