-
Fototrend

Ú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!
- Telekom otthoni szolgáltatások (TV, internet, telefon)
- Apple MacBook
- Xiaomi 15 - kicsi telefon nagy energiával
- Kerékpárosok, bringások ide!
- Luck Dragon: Asszociációs játék. :)
- AMD vs. INTEL vs. NVIDIA
- Horgász topik
- Napelem
- Nagyrobogósok baráti topikja
- Honor Magic6 Pro - kör közepén számok
- További aktív témák...
- Akció! Gamer PC-Számítógép! Csere-Beszámítás! R5 1600X / RX 580 8GB / 500GB SSD + 2TB HDD / 16GB RAM
- SOYO M4 Air Mini PC, Intel N95, 16 GB DDR4 RAM, 512 GB SSD
- Új Lenovo LOQ 15IRX10, FHD IPS, i7-13650HX ,NVIDIA RTX 5070, 24GB DDR5, 512GB NVMe, gar
- HÁLÓZATI SWITCH AKCIÓ! Több db egyben, használt, nem használt , dobozos, 24-, 26-, 48 portos!
- Bomba ár! Dell Latitude E5550 - i5-5GEN I 8GB I 500GB I 15,6" HD I HDMI I W10 I Cam I Gari!
- 211 - Lenovo Legion 5 (15ITH6H) - Intel Core i7-11800H, RTX 3060
- Decathlonos 43-as boxcipő, alig használt, hibátlan állapotban
- 201 - Lenovo Yoga Slim 7 (15ILL9) - Intel Core U7 258V, no GPU (ELKELT)
- ÁRGARANCIA!Épített KomPhone i5 14400F 32/64GB RAM RX 9060 XT 16GB GAMER PC termékbeszámítással
- BESZÁMÍTÁS! GIGABYTE A520M R5 1400 8GB DDR4 256GB SSD 500GB HDD GTX 1050 Ti 4GB ZALMAN S3 400W
Á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


