Results 1 to 3 of 3

Thread: Timer/thread/pulse or sumthing

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    Perth, WA
    Posts
    35

    Post

    Im looking for a way to increment a variable at a constant rate according to how long the program has been running, i know it must be possible to access the clock or possibly a thread like in java but i have no idea how

    specifically, im trying to move from one position in an array to the next each second or less( strange i know but theres a purpose) but it needs to affect the position of a picture as well, problably thru
    pic1.left = xpos(i)
    pic1.top = ypos(j)
    or similar

    any help on this would be appreciated

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    Can you use a Timer control for this?

    ------------------
    Mark Sreeves
    Analyst Programmer

    [email protected]
    A BMW Group Company

  3. #3
    Hyperactive Member razzaj's Avatar
    Join Date
    Oct 1999
    Location
    jounieh
    Posts
    261

    Post

    well as mark said , u must use a timer control here is some code :

    Private Sub Form_Load()
    Timer1.Interval = 1000 ' set the timer interval in milliseconds which means each 1000milliseconds ( 1 second) the sub timer1_timer will be accessed

    Timer1.Enabled = True
    End Sub

    Private Sub Timer1_Timer()
    Static x As Long
    x = x + 1
    Text1 = x
    ' pretty straight forward
    End Sub

    - regards -
    - razzaj -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width