1
Answer

C# graphics move rectangle

Lars Nilsson

Lars Nilsson

14y
6.2k
1
Hey guys,

I got kinda stuck now as Im working on something.

Im using C#'s paint event to draw the graphics, and I have a problem. If the rectangle variable Rect = a specific value, it should start there. Now if there is another position available,
it should simply move to this position in an animation done with a delay as the Thread.Sleep(); command.

What is the code for moving it say 100 pixels in X and about 50 pixels in Y?
I doesnt matter if the rectangle is redrawn on top of itself.

Thanks,

- Lars.
Answers (1)