I'm currently doing a project where I need to display few data in a loop. I need to display a data and then pause for a second, then display another and pause and so on. If I add System.Threading.Thread.Sleep(1000) My Application won't load for few seconds and shows me the final value. How else can I code?
int[] val = { 200, 400, 400, 300, 500, 250, 100, 600, 700, 450, 550, 300, 500, 600, 150, 250 };
high = val.Max();
low = val.Min();
for (int i = 0; i < 50; i++)
{
ovalShape1.FillColor = getColor(val[0]+ i*5);
ovalShape2.FillColor = getColor(val[1]+ i*3);
ovalShape3.FillColor = getColor(val[2]);
ovalShape4.FillColor = getColor(val[3]);
ovalShape5.FillColor = getColor(val[4]);
ovalShape6.FillColor = getColor(val[5]);
ovalShape7.FillColor = getColor(val[6] + i * 2);
ovalShape8.FillColor = getColor(val[7] + i * 4);
ovalShape9.FillColor = getColor(val[8] + i * 2);
ovalShape10.FillColor = getColor(val[9]);
ovalShape11.FillColor = getColor(val[10]);
ovalShape12.FillColor = getColor(val[11]);
ovalShape13.FillColor = getColor(val[12]);
ovalShape14.FillColor = getColor(val[13]);
ovalShape15.FillColor = getColor(val[14]);
ovalShape16.FillColor = getColor(val[15]);
}
getColor() is a function that returns some color. This code is just for testing. After each loop of for, i need the color of oval to stay for a second and then change color in next loop.