Help Moving Simulated Progress bar.

  • 15 years ago
    I Give,...I'm trying to create a simulated 3D Bitmap drawed image of a thin long shaded colored bar, which will represent a progress bar. When I Link this image into VB5 I have the image, but how do I get it to move, or seemingly slide fading away as in an enhanced RPG Game meter would be above a playing charecters head...??? Can anyone help.
  • 15 years ago

    Hi

    You can achieve this using two picture boxes. Place one picture box on a form, place the second picture box within the first picture box (such that the first picture box is the container of the second picture box).  Load your graphic into the second picture box, load a background graphic (if you wish) in the first picture box.

    The use some code like the following to move the second picture box within the first picture box, the first picture box has the effect of clipping the second picture box.

    Dim lngLoop As Long   

        For lngLoop = 0 To 3000

            Picture2.Left = -3000 + r

            DoEvents

        Next

    For better performance you should do the moving within a timer event or within you load / save / game play.

    Have fun

    Chris

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Engineers are all basically high-functioning autistics who have no idea how normal people do stuff.” - Cory Doctorow