Professional Documents
Culture Documents
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace calculator
public Form1()
InitializeComponent();
textBox1.ReadOnly = true;
textBox1.Text = String.Empty;
textBox1.Text += button1.Text;
}
textBox1.Text += button6.Text;
textBox1.Text += button7.Text;
textBox1.Text += button8.Text;
textBox1.Text += button11.Text;
textBox1.Text += button12.Text;
}
textBox1.Text += button13.Text;
textBox1.Text += button16.Text;
textBox1.Text += button17.Text;
//when 9 is pressed
textBox1.Text += button18.Text;
//. button
{
textBox1.Text += button2.Text;
//calculating squareroot
textBox1.Text += "sqrt(";
{
textBox1.Text = ans = String.Empty;
//sin function
textBox1.Text += "sin(";
textBox1.Text += "cos(";
textBox1.Text += "tg(";
//calculationg 1/x
textBox1.Text += "(1/";
}
textBox1.Text += "!";
textBox1.Text += "lg(";
textBox1.Text += "ln(";
if (textBox1.Text.Length > 0)
{}
textBox1.Text += "asin(";
textBox1.Text += "acos(";
{
textBox1.Text += "atg(";
{}
//permutation
textBox1.Text += "P";
//combination
textBox1.Text += "C";
Application.Exit();
{
Application.Exit();
textBox1.Text += button33.Text;
textBox1.Text += button40.Text;
if (ans.Length > 0)
textBox1.Text += ans;
else
ans = textBox1.Text;
textBox1.Text = String.Empty;
}
}