Click here to Skip to main content
15,917,618 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
PLSS need Help Im new Here XD
Tnx to People who help me :D
Posted

1 solution

Firstly, when you ask a question, the title is meant to be a summary - not the whole question!
What is it you are trying to do?
I assume you have a PictureBox on a Windows Forms application, and you want it to move about the form in some way.
You can use the PictureBox.Top and PictureBox.Left to move it about.
If we assume you want to move it left and right, bouncing off the form edges, then:
You will need a timer, with a suitable interval (maybe 200ms, you will have to decide). Call it movePictureTimer. Provide a handler for the Tick event, and start the timer.
In the movePictureBox.Tick event, add some small amount to the PictureBox.Left property.
Check that this does not move the picture box outside the form - use teh Form.Width property. If it does, in future take a small amount away from PictureBox.Left. Remember to check if it goes outside the form to the other side, and reverse again if it does.

There you go - one bouncing PictureBox!
 
Share this answer
 
Comments
[no name] 18-Mar-11 5:15am    
sorry
how to move picture on spacific line ?
OriginalGriff 18-Mar-11 5:26am    
Please ask this as a separate question: and give more detail on your exact problem.
Otherwise the answers for these just get too long to read! :)
[no name] 18-Mar-11 10:29am    
thanx for ur reply

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