Dalczego moja wielowątkowośc w tym przypadku nie działa?
Thread thread;
private void button1_Click(object sender, EventArgs e)
{
thread = new Thread(car1);
thread.Start();
}
public void car1()
{
int x = this.Width;
int y = this.Height;
pictureBox1.Width = 50;
pictureBox1.Height = 25;
Graphics g = pictureBox1.CreateGraphics();
Brush b = new SolidBrush(Color.Black);
g.FillRectangle(b, 0, 0, pictureBox1.Width - 1, pictureBox1.Height - 1);
pictureBox1.Invoke(new MethodInvoker(delegate ()
{
pictureBox1.Top = y / 4 - pictureBox1.Height;
for (int i = 0; i < x - pictureBox1.Width + 15; i++)
{
pictureBox1.Left = i;
for (float j = 0; j < 3000000; j++) ;
}
}));
}