private void button1_Click(object sender, EventArgs e)
 {
     try {
         SIGNIN s1 = new SIGNIN();
         if (s1.authentication(textBox2.Text, textBox1.Text))
         {
             panel2.Hide();
             panel1.Show();
             panel1.BringToFront();
             textBox1.Clear();
             textBox2.Clear();
             r1 = new read();
             int i = r1.read_data();
             MessageBox.Show(i.ToString());
             for (int a = 0; a < i - 1; a++)
             {
                 listBox1.Items.Add(r1.item_adder(a));
             }
         }
         else
         {
             timer1.Start();
             label6.Visible = true;
         }
     }
     catch (ArgumentNullException)
     {
         MessageBox.Show("EMPTY FIELDS");
     }
     catch (FileNotFoundException)
     { }
 }
        private void button6_Click(object sender, EventArgs e)
        {
            r1.item_delete(listBox1.SelectedIndex);
            r1.write_data();
            listBox1.Items.Clear();
            r1 = new read();
            int i = r1.read_data();

            //MessageBox.Show(i.ToString());
            for (int a = 0; a < i - 1; a++)
            {
                listBox1.Items.Add(r1.item_adder(a));
            }
        }
      private void button2_Click(object sender, EventArgs e)
      {
          if (a != null)
          {
              button2.BackgroundImage = a;
              button1.BackgroundImage = null;
              button3.BackgroundImage = null;
          }

          panel4.Top    = button2.Top;
          panel4.Height = button2.Height;
          detail.Show();
          detail.BringToFront();
          listBox1.Items.Clear();
          r1 = new read();
          int i = r1.read_data();

          //MessageBox.Show(i.ToString());
          for (int a = 0; a < i - 1; a++)
          {
              listBox1.Items.Add(r1.item_adder(a));
          }
      }