Animation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I could use some assistance in code writing, as I am trying to create a simple colored picturebox that moves back and forth, repetetively, (left to right and back again, etc.). Below is one of the closest I have come up with thus far

If P1.Left < 900 The
P1.Left = P1.Left +
End I
If P1.Left >= 900 The
P1.Left = P1.Left -
End I
 
You need to store the direction somewhere (ie member variable).

Pseudo-code:

if Left < Min
Direction = Speed

if Left > Max
Direction = -Speed

Left = Left + Direction

(Start Left at Min and Speed at positive value).

HTH

Stu


dr. S. said:
I could use some assistance in code writing, as I am trying to create a
simple colored picturebox that moves back and forth, repetetively, (left to
right and back again, etc.). Below is one of the closest I have come up
with thus far.
 
Back
Top