/*
 * Created by SharpDevelop.
 * User: burin
 * Date: 15/3/2558
 * Time: 20:06
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace mycal
{
	/// <summary>
	/// Description of MainForm.
	/// </summary>
	public partial class MainForm : Form
	{
		// 7 + 8 = 9 + 7 = (166)
		int firstnumber;
		int secondnumber;
		int result;
		char sign=' ';
		string display;
		public MainForm() {	InitializeComponent();}
		void Button16Click(object sender, EventArgs e)
		{
			// be careful case sensitive
			secondnumber=System.Convert.ToInt32(textBox1.Text);
			textBox1.Text="";
			if(sign == '+'){
				result= firstnumber + secondnumber;		
			}
			display=System.Convert.ToString(result);
			textBox1.Text=display;
		}
		void Button14Click(object sender, EventArgs e)
		{
			firstnumber=System.Convert.ToInt32(textBox1.Text);
			sign = '+';
			textBox1.Text="";
		}		
		void Button4Click(object sender, EventArgs e)
		{
			textBox1.Text = textBox1.Text + "7";
		}
		void Button5Click(object sender, EventArgs e)
		{
			textBox1.Text = textBox1.Text + "8";
		}
		void Button6Click(object sender, EventArgs e)
		{
			textBox1.Text = textBox1.Text + "9";
		}

	}
}
