Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Am moving an picturebox1 using arrow keys of keyboard when I hit another picturebox2 i want to stop and not to overlap the picturebox2
Posted
Comments
Sergey Alexandrovich Kryukov 9-Jan-13 19:51pm    
Why using PictireBox? Most inquirers asking about this control do not really have to use it.
—SA

Thank you all I got it,it was not simple since the movement is by using keys
as I mentioned..
 
Share this answer
 
OK, so before you move the second picturebox, check the new position and size of the box and make sure that it's not going to intersect the position and size of the first picturebox. This is pretty simple math. What's the problem?
 
Share this answer
 
Comments
OneInNineMillion 9-Jan-13 14:44pm    
Agreed.

@ sarathsprakash: It would be very helpful if you could show us what you have so far (code) so we can help you from there.
Dave Kreskowiak 9-Jan-13 15:04pm    
You might want to reply to the OP, not me. I'm not the one with the code and problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900