using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

 

namespace saf

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

        public saf1 sf1 = new saf1();

        private void button1_Click(object sender, EventArgs e)

        {

            int delete = 0;

            if (checkBox1.Checked)

            {

                /*meghdare text be sorate adad

                 * ra be saf ezafe mikonam*/

                sf1.addq(Int32.Parse(textBox1.Text));

 

                /*meghdare textbox ra ke midanam meghdare saf hast niz be

                 * list ezafe mikonam*/

                listBox1.Items.Add(textBox1.Text);

 

            }

            else

            {

                sf1.delq(ref delete);

                textBox2.Text = delete.ToString();

                listBox1.Items.Remove(textBox2.Text);

 

            }  

        }

 

        private void Form1_Load(object sender, EventArgs e)

        {

         

        }

    }

}