Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey guys... i'm trying to make a picturebox move after i click the start button until it reaches a certain point. And i don't want to click the button every time i want the picturebox to move, once i click it the picturebox should just start moving .. Plz Plz help me i cant find it anywhere.
Posted

1 solution

'Moving' means 'drawing it at different places corresponding to different times'.
You just need to know how to use a timer. I would Google with: "C# using a timer for moving a picture box"[^].
 
Share this answer
 
Comments
AndrewCharlz 3-Oct-14 8:15am    
its enf only if we change the location of the object

in timer evnt

picturebox1.Location = new Point(40, 40);

use some validation to make it move like marquee....
Rida Iftikhar 3-Oct-14 9:18am    
Is there no other way to keep the picturebox moving? My assignment is to make a simple reflex agent, would the timer be the right choice to move my 'agent' because after this I have to make model based and goal based agents and i don't think the timer would work there.
CPallini 3-Oct-14 9:25am    
You cannot avoid a timer, even with agents. "Moving" implies "Timer". Your agents would probably be implemented as state machines with transitions happening at timer ticks.
Rida Iftikhar 3-Oct-14 9:44am    
Ok I'll try the timer then and thank you so much for your help.
CPallini 3-Oct-14 13:39pm    
You are welcome.

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