Results 1 to 11 of 11

Thread: timer... *SOLVED*

  1. #1

    Thread Starter
    Addicted Member Rudy's Avatar
    Join Date
    Sep 2000
    Location
    BC, Canada
    Posts
    198

    timer... *SOLVED*

    i have a timer but for some reasons, when the app loses focus, the timer doesn work is there a way to tell the timer to keep going even when the form is not in focus?
    Last edited by Rudy; Oct 2nd, 2002 at 05:32 PM.
    *Rudy^
    Visual Studio 6 Ent. SP5
    Windows 2000 SP4
    Windows XP SP1a

  2. #2

    Thread Starter
    Addicted Member Rudy's Avatar
    Join Date
    Sep 2000
    Location
    BC, Canada
    Posts
    198
    actually, the form is .visible = false
    *Rudy^
    Visual Studio 6 Ent. SP5
    Windows 2000 SP4
    Windows XP SP1a

  3. #3
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    That's weird!! Are you sure you're not setting it's enabled property to false in any way?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  4. #4

    Thread Starter
    Addicted Member Rudy's Avatar
    Join Date
    Sep 2000
    Location
    BC, Canada
    Posts
    198
    100% sure

    the timer is supposed to call another form after a while, but if i go and start doing stuff (ie: open IE or something else) the form wont appear but if i just sit there and wait, it will
    *Rudy^
    Visual Studio 6 Ent. SP5
    Windows 2000 SP4
    Windows XP SP1a

  5. #5
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Remember that the default property of the Timer is Enabled, not interval. You might be setting some value to it that could set it to be disabled.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  6. #6
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    This code works!

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.     Me.Visible = False
    5. End Sub
    6.  
    7. Private Sub Timer1_Timer()
    8.     Debug.Print "Hello"
    9. End Sub
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  7. #7

    Thread Starter
    Addicted Member Rudy's Avatar
    Join Date
    Sep 2000
    Location
    BC, Canada
    Posts
    198
    nop, im not touching the timer at all, the timer loads when the form load and i never ever touch the timer


    but what i dont understand is that if i sit there and do nothing it will work but if i openanother window, it wont work
    *Rudy^
    Visual Studio 6 Ent. SP5
    Windows 2000 SP4
    Windows XP SP1a

  8. #8
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Me neither.... that's so weird.

    Can you post the code and/or the code?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  9. #9

    Thread Starter
    Addicted Member Rudy's Avatar
    Join Date
    Sep 2000
    Location
    BC, Canada
    Posts
    198
    //this loads the form the timer is on
    frmTimer.hrs = Left(Data, 2)
    frmTimer.Min = Mid(Data, 3, 2)
    frmTimer.sec = Mid(Data, 5, 2)
    Load frmTimer

    //this is what the timer does

    Private Sub Timer1_Timer()
    sec = sec - 1
    If sec = 0 Then
    If min = 0 Then
    If hrs = 0 Then
    Load frmMain
    frmMain.Show
    Unload frmTimer
    End If
    hrs = hrs - 1
    min = 59
    sec = 59
    End If
    min = min - 1
    sec = 59
    End If
    End Sub
    //this is the ONLY code contained in frmtimer
    *Rudy^
    Visual Studio 6 Ent. SP5
    Windows 2000 SP4
    Windows XP SP1a

  10. #10

    Thread Starter
    Addicted Member Rudy's Avatar
    Join Date
    Sep 2000
    Location
    BC, Canada
    Posts
    198
    nevermind, i fixed my own problem, the form i was loading wasnt set properly....thanx anywayz
    *Rudy^
    Visual Studio 6 Ent. SP5
    Windows 2000 SP4
    Windows XP SP1a

  11. #11
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Thumbs up

    You're welcome
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

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