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 ch7_6
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private ComplexNumber x = new ComplexNumber();
        private ComplexNumber y = new ComplexNumber();

        private void First_Click(object sender, EventArgs e)
        {
            x.Real = Int32.Parse(textBox1.Text);
            x.Imaginary = Int32.Parse(textBox2.Text);
            textBox1.Clear();
            textBox2.Clear();
            resultLabel.Text = "First Complex number is : " + x;
        }

        private void Second_Click(object sender, EventArgs e)
        {
            y.Real = Int32.Parse(textBox1.Text);
            y.Imaginary = Int32.Parse(textBox2.Text);
            textBox1.Clear();
            textBox2.Clear();
            resultLabel.Text = "Second Complex number is : " + y;
        }

        private void add_Click(object sender, EventArgs e)
        {
            resultLabel.Text = x + " + " + y + " = " + (x + y);
        }

        private void sub_Click(object sender, EventArgs e)
        {
            resultLabel.Text = x + " - " + y + " = " + (x - y);
        }

        private void mul_Click(object sender, EventArgs e)
        {
            resultLabel.Text = x + " * " + y + " = " + (x * y);
        }
    }
}
