Advertisement
ntamas

gombok

Mar 3rd, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.71 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 WindowsFormsApplication1
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.           InitializeComponent();
  17.         }
  18.         private void Form1_Load(object sender, EventArgs e)
  19.         {
  20.  
  21.         }
  22.         private void groupBox1_Enter(object sender, EventArgs e)
  23.         {
  24.  
  25.         }
  26.  
  27.         private void button1_Click(object sender, EventArgs e)
  28.         {
  29.           /*label1.Text = "Címke";                   // 1. feladat
  30.           button1.Text = "OKgomb";*/                 // 2. feladat
  31.           //label1.Text = textBox1.Text;
  32.           int a, b;
  33.           a = Convert.ToInt32(textBox1.Text);
  34.           b = Convert.ToInt32(textBox2.Text);
  35.           label1.Text = Convert.ToString(a * b);
  36.         }
  37.         private void label1_Click(object sender, EventArgs e)
  38.         {
  39.  
  40.         }
  41.         static int bal, jobb;
  42.         private void textBox1_TextChanged(object sender, EventArgs e)
  43.         {
  44.           if (textBox1.Text == "")
  45.           {
  46.             bal = 0;
  47.           }
  48.           else
  49.           {
  50.             bal = Convert.ToInt32(textBox1.Text);
  51.           }
  52.           label1.Text = Convert.ToString(bal * jobb);
  53.         }
  54.         private void textBox2_TextChanged(object sender, EventArgs e)
  55.         {
  56.           if (textBox2.Text == "")
  57.           {
  58.             jobb = 0;
  59.           }
  60.           else
  61.           {
  62.             jobb = Convert.ToInt32(textBox2.Text);
  63.           }
  64.           label1.Text = Convert.ToString(bal * jobb);
  65.         }
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement