Hey!
I have a question.
I have this code:
int size = Convert.ToInt32(numericUpDown1.Value) + 1;
var item_c = listView1.Items.Count;
int id = 0;
while (true)
{
if (id == item_c)
{
break;
}
for(int i = 0; i < size; i++)
{
if (id == item_c)
{
break;
}
Thread[] array = new Thread[size];
for (int k = 0; k < size; k++)
{
if (id == item_c)
{
break;
}
ParameterizedThreadStart start = new ParameterizedThreadStart(DoChecking);
array[k] = new Thread(start);
array[k].Start(id);
id++;
}
}
}
It works well.. But only problem is that when I run it then it crashes.. BUT if I add messagebox to display "id" below "id++" then it works perfectly and it doesn't crash.
Have you any idea how to fix it ?