use the following code:
Code Snippet
listBox1.Invoke((MethodInvoker)delegate
{
listBox1.Items.Add(ar[i].ToString());
});
The problem is, that you can't update the UI in another thread. Control.Invoke acts like a SendMessage and so,the delegate is invoked in the UI thread instead.