0
How to move an image in a 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);
}
}
It even moves the image, only there’s a trace:
How to prevent this?
That’s right. Thanks, thank you very much.
– Jothaz