title: Immediately updating a listbox
body: <p>I have an application that checks a number of 7zip arhive if they are not corrupt, and I want to write every action in a listbox, but my problem is that the listbox doesn't display each line when I add an item to it, it updates at finish, and puts all the items at the end of my action even if I use the property .StartUpdate() and EndUpdate()</p>
  
  <p>This is a part of my code:</p>
  
  <pre><code>foreach (string director in foldere)
  {
      if (director.ToLower().Contains("cluj") || director.ToLower().Contains("craiova") || director.ToLower().Contains("timisoara"))
      {
          String[] zipFile = Directory.GetFiles(director, "*.7z");
          foreach (string zip7 in zipFile)
          {
              //check arhive
              SevenZipExtractor zipfile = new SevenZipExtractor(zip7);
              if (zipfile.Check())
              {
                  String[] fisFaraArhiva = Directory.GetFiles(director, "*.*");
                  foreach (string fisere in fisFaraArhiva)
                  {
                      if (fisere != zip7)
                      {
                          File.Delete(fisere);
                      }
                  }
                  listBox1.Items.Insert(0, "A fost sters fisierele din directorul " + director);
                  string[] fisComanda = Directory.GetFiles(utilizator, "*" + id + "*");
                  foreach (string cmd in fisComanda)
                  {
                      File.Move(cmd, Path.Combine(director, Path.GetFileName(cmd)));
                      listBox1.BeginUpdate();
                      listBox1.Items.Insert(0, "A fost mutata comanda " + Path.GetFileName(cmd) + " in director");
                      listBox1.EndUpdate();
                  }
              }
              else
              {
                  MessageBox.Show("Arhiva nu este ok");
                  listBox1.BeginUpdate();
                  listBox1.Items.Insert(0, "Arhiva " + zip7 + " NU este OK");
                  listBox1.BackColor = Color.Red;
                  listBox1.EndUpdate();
              }
          }
      }
  }
  if (listBox1.BackColor != Color.Red)
  {
      listBox1.BeginUpdate();
      listBox1.BackColor = Color.Green;
      listBox1.EndUpdate();
  }
  </code></pre>