Page 1
Bienvenido a su calculadora
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 Numeros_Complejos{ public partial class Form2 : Form { public Form2() { InitializeComponent(); }
private void timer1_Tick(object sender, EventArgs e) { this.Dispose(true); }
private void textBox1_TextChanged(object sender, EventArgs e) {
} }}
Primer numero
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 Numeros_Complejos{ public partial class Form1 : Form {
Complejo micomp1; Complejo micomp2; Complejo res = new Complejo(); String ig;
Page 2
public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) { Form mipresentacion; mipresentacion = new Form2(); mipresentacion.ShowDialog(); }
private void pictureBox1_Click(object sender, EventArgs e) { try { micomp1 =new Complejo( double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 =new Complejo( double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res= micomp1+micomp2; label8.Text = "" + micomp1.R+" + " + micomp1.I+" i"; label9.Text = micomp2.R+" + " +micomp2.I+ " i"; label10.Text = "El resultado de la suma es= "+ res.R+" + "+res.I+" i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text=""; label9.Text=""; label10.Text=""; }
}
private void pictureBox2_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res = micomp1 - micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i";
Page 3
label10.Text = "El resultado de la resta es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void pictureBox3_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res = micomp1 * micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = "El resultado de la multiplicación es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void pictureBox4_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res = micomp1 /micomp2;
Page 4
label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = "El resultado de la división es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void pictureBox5_Click(object sender, EventArgs e) { }
private void pictureBox6_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); ig = micomp1 == micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = ig;
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void button1_Click(object sender, EventArgs e) { textBox1.Text = "";
Page 5
textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; }
private void button2_Click(object sender, EventArgs e) { Application.Exit(); }
private void label2_Click(object sender, EventArgs e) {
} }}
Segundo numero
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 Numeros_Complejos{ public partial class Form1 : Form {
Complejo micomp1; Complejo micomp2; Complejo res = new Complejo(); String ig; public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) { Form mipresentacion; mipresentacion = new Form2(); mipresentacion.ShowDialog(); }
private void pictureBox1_Click(object sender, EventArgs e) { try
Page 6
{ micomp1 =new Complejo( double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 =new Complejo( double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res= micomp1+micomp2; label8.Text = "" + micomp1.R+" + " + micomp1.I+" i"; label9.Text = micomp2.R+" + " +micomp2.I+ " i"; label10.Text = "El resultado de la suma es= "+ res.R+" + "+res.I+" i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text=""; label9.Text=""; label10.Text=""; }
}
private void pictureBox2_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res = micomp1 - micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = "El resultado de la resta es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; }
Page 7
}
private void pictureBox3_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res = micomp1 * micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = "El resultado de la multiplicación es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void pictureBox4_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res = micomp1 /micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = "El resultado de la división es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = "";
Page 8
label10.Text = ""; } }
private void pictureBox5_Click(object sender, EventArgs e) { }
private void pictureBox6_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); ig = micomp1 == micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = ig;
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void button1_Click(object sender, EventArgs e) { textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; }
private void button2_Click(object sender, EventArgs e) { Application.Exit(); }
private void label2_Click(object sender, EventArgs e) {
}
Page 9
private void label3_Click(object sender, EventArgs e) {
} }}
Ingrese parte real
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 Numeros_Complejos{ public partial class Form1 : Form {
Complejo micomp1; Complejo micomp2; Complejo res = new Complejo(); String ig; public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) { Form mipresentacion; mipresentacion = new Form2(); mipresentacion.ShowDialog(); }
private void pictureBox1_Click(object sender, EventArgs e) { try { micomp1 =new Complejo( double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 =new Complejo( double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res= micomp1+micomp2; label8.Text = "" + micomp1.R+" + " + micomp1.I+" i"; label9.Text = micomp2.R+" + " +micomp2.I+ " i";
Page 10
label10.Text = "El resultado de la suma es= "+ res.R+" + "+res.I+" i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text=""; label9.Text=""; label10.Text=""; }
}
private void pictureBox2_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res = micomp1 - micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = "El resultado de la resta es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void pictureBox3_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text));
Page 11
micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res = micomp1 * micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = "El resultado de la multiplicación es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void pictureBox4_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res = micomp1 /micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = "El resultado de la división es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void pictureBox5_Click(object sender, EventArgs e) { }
Page 12
private void pictureBox6_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); ig = micomp1 == micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = ig;
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void button1_Click(object sender, EventArgs e) { textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; }
private void button2_Click(object sender, EventArgs e) { Application.Exit(); }
private void label2_Click(object sender, EventArgs e) {
}
private void label3_Click(object sender, EventArgs e) {
}
private void label5_Click(object sender, EventArgs e) {
Page 13
} }}
Ingrese parte imaginaria
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 Numeros_Complejos{ public partial class Form1 : Form {
Complejo micomp1; Complejo micomp2; Complejo res = new Complejo(); String ig; public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) { Form mipresentacion; mipresentacion = new Form2(); mipresentacion.ShowDialog(); }
private void pictureBox1_Click(object sender, EventArgs e) { try { micomp1 =new Complejo( double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 =new Complejo( double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res= micomp1+micomp2; label8.Text = "" + micomp1.R+" + " + micomp1.I+" i"; label9.Text = micomp2.R+" + " +micomp2.I+ " i"; label10.Text = "El resultado de la suma es= "+ res.R+" + "+res.I+" i";
Page 14
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text=""; label9.Text=""; label10.Text=""; }
}
private void pictureBox2_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res = micomp1 - micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = "El resultado de la resta es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void pictureBox3_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text));
Page 15
res = micomp1 * micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = "El resultado de la multiplicación es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void pictureBox4_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res = micomp1 /micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = "El resultado de la división es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void pictureBox5_Click(object sender, EventArgs e) { }
private void pictureBox6_Click(object sender, EventArgs e)
Page 16
{ try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); ig = micomp1 == micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = ig;
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void button1_Click(object sender, EventArgs e) { textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; }
private void button2_Click(object sender, EventArgs e) { Application.Exit(); }
private void label2_Click(object sender, EventArgs e) {
}
private void label3_Click(object sender, EventArgs e) {
}
private void label5_Click(object sender, EventArgs e) {
}
Page 17
private void label7_Click(object sender, EventArgs e) {
} }}
Suma
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 Numeros_Complejos{ public partial class Form1 : Form {
Complejo micomp1; Complejo micomp2; Complejo res = new Complejo(); String ig; public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) { Form mipresentacion; mipresentacion = new Form2(); mipresentacion.ShowDialog(); }
private void pictureBox1_Click(object sender, EventArgs e) { try { micomp1 =new Complejo( double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 =new Complejo( double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res= micomp1+micomp2; label8.Text = "" + micomp1.R+" + " + micomp1.I+" i"; label9.Text = micomp2.R+" + " +micomp2.I+ " i";
Page 18
label10.Text = "El resultado de la suma es= "+ res.R+" + "+res.I+" i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text=""; label9.Text=""; label10.Text=""; }
}
private void pictureBox2_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res = micomp1 - micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = "El resultado de la resta es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void pictureBox3_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text));
Page 19
micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res = micomp1 * micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = "El resultado de la multiplicación es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void pictureBox4_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); res = micomp1 /micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = "El resultado de la división es= " + res.R + " + " + res.I + " i";
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void pictureBox5_Click(object sender, EventArgs e) { }
Page 20
private void pictureBox6_Click(object sender, EventArgs e) { try { micomp1 = new Complejo(double.Parse(textBox1.Text), double.Parse(textBox2.Text)); micomp2 = new Complejo(double.Parse(textBox3.Text), double.Parse(textBox4.Text)); ig = micomp1 == micomp2; label8.Text = "" + micomp1.R + " + " + micomp1.I + " i"; label9.Text = micomp2.R + " + " + micomp2.I + " i"; label10.Text = ig;
} catch (SystemException e1) { MessageBox.Show("Por favor las entradas deben ser numericas!!!" + e1.Message, "Mensaje de error", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; } }
private void button1_Click(object sender, EventArgs e) { textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; label8.Text = ""; label9.Text = ""; label10.Text = ""; }
private void button2_Click(object sender, EventArgs e) { Application.Exit(); }
private void label2_Click(object sender, EventArgs e) {
}
private void label3_Click(object sender, EventArgs e) {
}
private void label5_Click(object sender, EventArgs e) {
Page 21
}
private void label7_Click(object sender, EventArgs e) {
} }}