Advertisement
VWB

Calculadora em form

VWB
Sep 10th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.79 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace T2IT1_Exercicio0702
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.  
  19.         private void button6_Click(object sender, EventArgs e)
  20.         {
  21.             Close();
  22.         }
  23.  
  24.         private void button5_Click(object sender, EventArgs e)
  25.         {
  26.             textBox1.Clear();
  27.             textBox2.Clear();
  28.             textBox3.Clear();
  29.  
  30.             textBox1.Focus();
  31.         }
  32.  
  33.         private void button1_Click(object sender, EventArgs e)
  34.         {
  35.             int vA, vB, res;
  36.  
  37.             vA = int.Parse(textBox1.Text);
  38.             vB = int.Parse(textBox2.Text);
  39.  
  40.             res = vA + vB;
  41.  
  42.             textBox3.Text = res.ToString();
  43.         }
  44.  
  45.         private void button2_Click(object sender, EventArgs e)
  46.         {
  47.             int vA, vB, res;
  48.  
  49.             vA = int.Parse(textBox1.Text);
  50.             vB = int.Parse(textBox2.Text);
  51.  
  52.             res = vA - vB;
  53.  
  54.             textBox3.Text = res.ToString();
  55.         }
  56.  
  57.         private void button3_Click(object sender, EventArgs e)
  58.         {
  59.             int vA, vB, res;
  60.  
  61.             vA = int.Parse(textBox1.Text);
  62.             vB = int.Parse(textBox2.Text);
  63.  
  64.             res = vA * vB;
  65.  
  66.             textBox3.Text = res.ToString();
  67.         }
  68.  
  69.         private void button4_Click(object sender, EventArgs e)
  70.         {
  71.             int vA, vB, res;
  72.  
  73.             vA = int.Parse(textBox1.Text);
  74.             vB = int.Parse(textBox2.Text);
  75.  
  76.             res = vA / vB;
  77.  
  78.             textBox3.Text = res.ToString();
  79.         }
  80.     }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement