0

I am creating a simple program where a character (Picture Box) is moved using the arrow keys through adjusting the x and y. I have figured out how to detect key presses and adjust the x and y, but I cannot figure out how to redraw the picture box so that it moves. I have used Google but none of the answers are working. Any help is appreciated.

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by ChrisHunter
0

You have to set the location of the pic box...

Ex : Point mypoint=new Point(x,y);
picbox1.Location=mypoint;

Here x & y are integers that you adjust.

Call Me at [phone number removed].. If Any More Query...

Edited by WaltP: You're kidding, right? Posting a phone number?!?!?!

0

I don't think you have to redraw the picture just set the starting position of picture box and update the start position by adding or subtracting every time one of the directional keys are pressed.

Do a search from a C# version of space invaders, I've done that in Java before and it includes moving an image with arrow keys.

Hope this helps at all.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.