Hirdetés
-
PROHARDVER!

Új hozzászólás Aktív témák
-
klambi
addikt
na jó
public partial class Form1 : Form
{
bool osszead = false;
bool kivonas = false;
bool szorzas = false;
bool osztas = false;
public Form1()
{
InitializeComponent();
}private void Form1_Load(object sender, EventArgs e)
{}
private void button9_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + '1';
}private void button10_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + '2';
}private void button11_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + '3';
}private void button14_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + '4';
}private void button13_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + '5';
}private void button12_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + '6';
}private void button17_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + '7';
}private void button16_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + '8';
}private void button15_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + '9';
}private void button18_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + '0';
}private void button8_Click(object sender, EventArgs e)
{
if (textBox1.Text.Contains('.'))
{
return;
}
else
{
textBox1.Text = textBox1.Text + '.';
}
}private void button19_Click(object sender, EventArgs e)
{
if (textBox1.Text.Contains('-'))
{
textBox1.Text = textBox1.Text.Remove(0, 1);
}
else
{
textBox1.Text = "-" + textBox1.Text;
}
}private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
{
osszead = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}private void button5_Click(object sender, EventArgs e)
{
if (osszead)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) + Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();}
if (szorzas)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) * Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();}
if (osztas)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) / Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();}
if (kivonas)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) - Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();}
}private void button2_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
{
kivonas = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}private void button3_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
{
szorzas = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}private void button4_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
{
osztas = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}private void button6_Click(object sender, EventArgs e)
{
osztas = osszead = kivonas = szorzas = false;
textBox1.Text = "";
textBox1.Tag = "";
}
}
}simán mennek a dolgok, de a 0 val való osztással szintaktikailag volt gondom...ki is vettem belőle, pontosan hogy lenne az?
Új hozzászólás Aktív témák
● olvasd el a téma összefoglalót!
- Tuning kezdőknek
- Az RSR Porsche Design is csatlakozott a Magic8 szériához
- Projektor topic
- Gitáros topic
- Kamionok, fuvarozás, logisztika topik
- A legrosszabb CPU-k – az ExtremeTech szerint
- Elektromos cigaretta 🔞
- Sí, sielés
- Megérkezett a Google Pixel 7 és 7 Pro
- Milyen széket vegyek?
- További aktív témák...
- 5070
- HP Victus 16 - 16.1"FHD 144Hz - Ryzen 5 7640HS - 32GB - 1TB - Win11 -RTX 4050 - 1,5 év gari - MAGYAR
- SAPPHIRE NITRO+ AMD Radeon RX 7900 XT Vapor-X 20G
- ÚJ BONTATLAN Apple Watch Series SE3 40mm Stairlight Azonnal Átvehető DEÁK TÉRNÉL 1 Év Apple Garancia
- G.SKILL Aegis 16GB (2x8GB) DDR4 3200MHz F4-3200C16D-16GIS új 2 pár
- BESZÁMÍTÁS! GIGABYTE A520M R7 3800X 16GB DDR4 512GB SSD RX 9060 XT 16GB Zalman T3 Plus CM 650W
- Samsung Galaxy Watch 6 40mm, Újszerű, 1 Év Garanciával
- Playstation Portal 6 hó garancia, számlával!
- 199 - Lenovo Legion Pro 5 (16IAX10) - Intel Core U9 275HX, RTX 5070 (ELKELT)
- Újszerű Apple MacBook Air M1 13.3 - 8GB/256GB - Asztroszürke - 150 Ciklus - 92% akku - 1 év gari -
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs



