?
Solved

moving a picture

Posted on 2003-03-25
8
Medium Priority
?
164 Views
Last Modified: 2010-05-01
I want to slowly move picture upwards vertically. It starts on the form at pic.top = 4000 and I want it to move up a certain distance depending on a variable (A). The variable A is entered on a different form and when this form opens the picture should move.


Private Sub Form_Load()
z = 0
End Sub

Private Sub time_Timer()
Do While z < A
pic.Top = 4000 - z
z = z + 1
Loop


0
Comment
Question by:j8907dwyer
8 Comments
 
LVL 2

Expert Comment

by:Jacamar
ID: 8206068
dim z as integer

Private Sub Form_Load()
z = 0
End Sub

Private Sub time_Timer()
dim A as integer
A = cint(Form1.Text1.text)
Do While z < A
pic.Top = 4000 - z
z = z + 1
Loop
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8206082
Private Sub time_Timer()
static i as long
if i=4000 then
   time.enabled=false
else
   pic.Top = 4000 - z
   i = i + 1

end if
end sub

but if value i is in another form you should full reference it and not use static declaration:

Private Sub time_Timer()

if form2.i=4000 then
   time.enabled=false
else
   pic.Top = 4000 - form2.i
   form2.i = form2.i + 1

end if
end sub


' form2
public i as long
0
 
LVL 11

Expert Comment

by:supunr
ID: 8206846
Private Sub Form_Load()
   z = 0
End Sub

Private Sub time_Timer()
    if (z < A) then
         time.Enabled = false
         exit sub
    exit sub
    pic.Top = 4000 - z
    z = z + 1
Loop


' I recommend you disabling the time in design time and enabling the time when form activates (because there is a small time lag between form_load and form_activate
Private Sub Form_Activate()
    time.Enabled = true
End Sub

Good Luck!
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Expert Comment

by:defy_boy
ID: 8207279
at design time, hold your left mouse button down on the picture and move the mouse in a slow upward position
0
 
LVL 3

Expert Comment

by:n_narayanan
ID: 8218768
Hi

Go to http://www.a1vbcode.com/search.asp

Type "animation" in the search box (Located in top right corner) and click search.

There are plenty of downloads. You might find a nice one over there.

Enjoy!

Cheers

Narayanan
0
 

Expert Comment

by:CleanupPing
ID: 8531619
Hi j8907dwyer,
This old question (QID 20562918) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 9441063
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->PAQ - no points refunded

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0
 

Accepted Solution

by:
YensidMod earned 0 total points
ID: 9495715
This question is PAQed and no points refunded (of 70)

YensidMod
Expert Exchange Moderator
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month9 days, 23 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question