30 Kasım 2016 Çarşamba

C# - Form Application TextBox, CheckBox, ComboBox, GroupBox ve ListBox ile Sipariş Sistemi Yapımı


namespace Örnek1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            listBox1.Items.Add(textBox1.Text);
            listBox2.Items.Add(textBox2.Text);
            listBox3.Items.Add(textBox3.Text);
            listBox4.Items.Add(comboBox1.Text);
            listBox5.Items.Add(comboBox2.Text);
            listBox6.Items.Add(
                (checkBox1.Checked ? checkBox1.Text + " " : "")+
                (checkBox2.Checked ? checkBox2.Text + " " : "")+
                (checkBox3.Checked ? checkBox3.Text + " " : "")+
                (checkBox4.Checked ? checkBox4.Text + " " : "")+
                (checkBox5.Checked ? checkBox5.Text + " " : "")+
                (checkBox6.Checked ? checkBox6.Text + " " : ""));
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.Clear();
            textBox2.Clear();
            textBox3.Clear();
            comboBox1.Text = "";
            comboBox2.Text = "";
            listBox1.Items.Clear();
            listBox2.Items.Clear();
            listBox3.Items.Clear();
            listBox4.Items.Clear();
            listBox5.Items.Clear();
            listBox6.Items.Clear();
            checkBox1.Checked = false;
            checkBox2.Checked = false;
            checkBox3.Checked = false;
            checkBox4.Checked = false;
            checkBox5.Checked = false;
            checkBox6.Checked = false;

        }
    }
}

Hiç yorum yok:

Yorum Gönder