?
Solved

moving a picture

Posted on 2003-03-25
8
Medium Priority
?
163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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

770 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