Created
December 8, 2012 19:23
-
-
Save thenonameguy/4241513 to your computer and use it in GitHub Desktop.
Javított Tortosztalygrafikus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Windows.Forms; | |
namespace TortOsztalyosGrafikus | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ | |
InitializeComponent(); | |
radioButton1.Checked = true; | |
} | |
private void button1_Click(object sender, EventArgs e) | |
{ | |
if (radioButton1.Checked) { label1.Text = "+"; } | |
if (radioButton2.Checked) { label1.Text = "-"; } | |
if (radioButton3.Checked) { label1.Text = "*"; } | |
if (radioButton4.Checked) { label1.Text = "/"; } | |
int a = Convert.ToInt32(textBox1.Text); | |
int b = Convert.ToInt32(textBox2.Text); | |
int c = Convert.ToInt32(textBox3.Text); | |
int d = Convert.ToInt32(textBox4.Text); | |
Tort elsoszam=new Tort(a,b); | |
Tort masodikszam=new Tort(c,d); | |
switch (label1.Text) | |
{ | |
case "+": | |
label3.Text = (elsoszam + masodikszam).Kiir(); | |
break; | |
case "-": | |
label3.Text = (elsoszam - masodikszam).Kiir(); | |
break; | |
case "*": | |
label3.Text = (elsoszam * masodikszam).Kiir(); | |
break; | |
case "/": | |
label3.Text = (elsoszam / masodikszam).Kiir(); | |
break; | |
default: | |
break; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment