Click to See Complete Forum and Search --> : How to ......


AndyK
November 2nd, 1999, 06:45 PM
How to make invert this code:
x = Picture1.Height
x = 0
Do Until x >= 4700
x = x + 1
me.Refresh
Picture1.Height = x
Loop


so that it will scroll from bottom to top not from top to bottom

Thank You

Sky1000
November 2nd, 1999, 08:39 PM
If you are doing something like that, it is probably better to use a timer than a do loop, but the idea is the same. I think the visual effect you will get is that it cuts off from the bottom up. You would initiate the value of X like you have written at x = Picture1.Height, then in your do loop decrement x by one, x=x-1. and set the condition to loop until x = 0.

Sky1000

PedroD
November 3rd, 1999, 04:12 AM
Simple.
Just use the TOP and LEFT member variables to set the upper left position of
your control coninuosly, i.e.


dim lngX as long
dim lngY as long
dim lngXSize as long

lngXSize = 0
while lngXSize <= 4700
lngXSize = lngXSize + 1
lngX = 0
lngY = 0
picture1.top = lngY
picture1.left = lngX
picture1.height = lngXSize
me.repaint
wend

AndyK
November 3rd, 1999, 01:54 PM
hmm, PedroD? your code does the same function as mine, but I need to reverse it and your code seem to do the same thing --- from top to bottom but I need to go from BOTTOM to TOP and so that upper part was moving and lower part (base) would remain still...that's what kind of progress bar I need

PedroD
November 4th, 1999, 02:05 AM
Sorry about that.. Didn't see that your code was placing the picture object.
Here's what you need to do in order to get a "bottoms up" version of the mentioned code snippet:


Dim lngPictureHeight as Long ' The final height of the picture
Dim lngBaseLineY as Long ' The base line for the picture (vertical)
Dim lngYpos as Long ' ditto

lngBaseLineY = 4700 ' Base distance from Top
lngPictureHeight = 3000 ' Insert correct value here
lngYpos = lngBaseLineY ' Vertical start position


While (lngBaseLineY - lngYpos) < lngPictureHeight
lngYpos = lngYpos - 1
picture1.top = lngYpos ' Move picture up
picture1.height = picture1.height + 1 ' Scale the vertical size
...(perhaps a delay here)...
me.repaint
Wend




Hope this helps

Pedro