Skip to content

Instantly share code, notes, and snippets.

@thenonameguy
Created December 8, 2012 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thenonameguy/4241513 to your computer and use it in GitHub Desktop.
Save thenonameguy/4241513 to your computer and use it in GitHub Desktop.
Javított Tortosztalygrafikus
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