Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. namespace Calculadora_2._0
  2. {
  3. public partial class Form1 : Form
  4. {
  5. public Form1()
  6. {
  7. InitializeComponent();
  8. }
  9.  
  10. private void label1_Click(object sender, EventArgs e)
  11. {
  12.  
  13. }
  14.  
  15. private void button2_Click(object sender, EventArgs e)
  16. {
  17.  
  18. }
  19.  
  20. private void button4_Click(object sender, EventArgs e)
  21. {
  22.  
  23. }
  24.  
  25. private void button5_Click(object sender, EventArgs e)
  26. {
  27.  
  28. }
  29.  
  30. private void label3_Click(object sender, EventArgs e)
  31. {
  32.  
  33. }
  34.  
  35. private void label4_Click(object sender, EventArgs e)
  36. {
  37.  
  38. }
  39.  
  40. private void button1_Click(object sender, EventArgs e)
  41. {
  42. int num1, num2, resultado;
  43.  
  44. num1 = Convert.ToInt16(textBox1.Text);
  45. num2 = Convert.ToInt16(textBox2.Text);
  46.  
  47. resultado = num1 + num2;
  48.  
  49. if (textBox1.Text == null)
  50. {
  51. throw new System.ArgumentException("Parameter cannot be null", "original");
  52. }
  53.  
  54. if (textBox2.Text == null)
  55. {
  56. throw new System.ArgumentException("Parameter cannot be null", "original");
  57. }
  58.  
  59. if (textBox1.Text == null) &&
  60. {
  61. throw new System.ArgumentException("Parameter cannot be null", "original");
  62. }
  63.  
  64. label4.Text = Convert.ToString(resultado);
  65. }
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement