I Improve my code but problem not solve.
int i = 0;
ParameterizedThreadStart start = new ParameterizedThreadStart(gh);
Thread.CurrentThread.Priority = ThreadPriority.Lowest;
Thread u = new Thread(start);
u.Priority = ThreadPriority.Highest;
while (i < 100)
{
if (u.IsBackground)
{
while (u.IsBackground)
{
if (!u.IsBackground) break;
}
}
u = new Thread(start);
i++;
u.Start(i);
System.Threading.Thread.Sleep(10);
}
}
void gh(object e)
{
if (InvokeRequired)
{
b = delegate()
{
label1.Text = string.Format("Step is :{0}", e.ToString());
};
Invoke(b);
}
else label1.Text = string.Format("Step is :{0}", e.ToString());
}