I have a pictureBox
in another pictureBox
. I try to create an imitation of flying plane on a map. I made a simple loop to do this task. The code:
for (var i = 0; i < 23; i++)
{
Fuel -= 1;
Changed(i);
}
private void Changed(int a)
{
Thread.Sleep(350);
pbPlane1.Location = new Point(525-(25*a), 235);
pbPlane1.Refresh();
}
So in this case the plane image is moving as I want but the old images are shown aswell, and I don't want it. I have tried a couple of things but with no results. What is wrong with my code?