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 uyg3 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { if (tabControl1.SelectedIndex == 2) { textBox4.Text = ""; textBox4.Text += textBox1.Text + "\r\n"; textBox4.Text+= textBox2.Text + "\r\n"; textBox4.Text += textBox3.Text + "\r\n"; decimal hesap = 0; if (numericUpDown1.Value > 0) { hesap += numericUpDown1.Value * 12; textBox4.Text += string.Format("Çorba{0:C}", numericUpDown1.Value * 12) + "\r\n"; } if (numericUpDown2.Value > 0) { hesap += numericUpDown2.Value * 10; textBox4.Text += string.Format("Salata{0:C}", numericUpDown2.Value * 10) + "\r\n"; } if (numericUpDown3.Value > 0) { hesap += numericUpDown3.Value * 20; textBox4.Text += string.Format("Ana Yemek{0:C}", numericUpDown3.Value * 20) + "\r\n"; } if(numericUpDown4.Value>0) { hesap += numericUpDown4.Value * 15; textBox4.Text += string.Format("Salata{0:C}", numericUpDown4.Value * 15) + "\r\n"; } textBox4.Text += "--------------"; textBox4.Text += string.Format("Toplam {0:C}",hesap); } } } }