How to move an image into a form windows form.
I used the following code:
private void button1_Click(object sender, EventArgs e)
{
int tamanhoFundo = picFundo.Width;
int x = myPic.Location.X;
int y = myPic.Location.Y;
while (x < tamanhoFundo)
{
int pos = x += 5;
myPic.Location = new Point(pos, myPic.Location.Y);
Thread.Sleep(500);
}
}
Even move the image, only a trace remains:
How to avoid this?