Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Calculadora_2._0
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void label1_Click(object sender, EventArgs e)
- {
- }
- private void button2_Click(object sender, EventArgs e)
- {
- }
- private void button4_Click(object sender, EventArgs e)
- {
- }
- private void button5_Click(object sender, EventArgs e)
- {
- }
- private void label3_Click(object sender, EventArgs e)
- {
- }
- private void label4_Click(object sender, EventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- int num1, num2, resultado;
- num1 = Convert.ToInt16(textBox1.Text);
- num2 = Convert.ToInt16(textBox2.Text);
- resultado = num1 + num2;
- if (textBox1.Text == null)
- {
- throw new System.ArgumentException("Parameter cannot be null", "original");
- }
- if (textBox2.Text == null)
- {
- throw new System.ArgumentException("Parameter cannot be null", "original");
- }
- if (textBox1.Text == null) &&
- {
- throw new System.ArgumentException("Parameter cannot be null", "original");
- }
- label4.Text = Convert.ToString(resultado);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement