title: How to remove items in listbox that was randomly selected using timer
body: <pre><code>private void button1_Click(object sender, EventArgs e)
      {
          timer1.Start();
          timer2.Start();
      }
  
      private void timer1_Tick(object sender, EventArgs e)
      {
          int a = int.Parse(label3.Text)
              + 1;
          label3.Text = a.ToString();
          if (label3.Text == "10")
          {
              listBox1.Items.Add(label1.Text);
              label3.Text = "0";
          }
      }
  
      private void timer2_Tick(object sender, EventArgs e)
      {
          Random rnd = new Random();
          int num = rnd.Next(1, listBox2.Items.Count);
          label1.Text = num.ToString();
          if (label3.Text == "10")
          {
              listBox1.Items.Add(label1.Text);
              listBox2.Items.Remove(label1.Text); //this line of code isnt working. It doesnt delete anything.
          }
      }
  </code></pre>
  
  <p>What i wanted to happen is my label1 will shuffle all the items(1-10) in my listbox2 using timer1 then if the timer reach 10 seconds the listbox1 will add label1 last number as its item and listbox2 will remove it. It's working fine but it doesnt remove what's in the listbox2</p>