Results 1 to 23 of 23

Thread: Can't start timer.

Threaded View

  1. #1

    Thread Starter
    Lively Member Mugsy323's Avatar
    Join Date
    Oct 2014
    Posts
    112

    Question Can't start timer.

    I created my own File Copy dialog (had to) and I'm trying to use a timer to add a simple 5-frame animation.

    I created a form and placed a Timer object on it. The timer is set to Enabled with an interval of 150 (I also tried 15.)

    When I call the form, the timer never starts (I placed a breakpoint in the "_Tick" event to confirm.)

    I call the form from another form using:

    Code:
    frmCopy.Activate()
    frmCopy.Timer1.Enabled = True
    BackupData()                    ' Backup settings.
    BackupData() IS executed. It contains frmCopy.Show() & frmCopy.Refresh()

    frmCopy's code:

    Code:
    Public Class frmCopy
    
        Private Sub frmCopy_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Timer1.Enabled = True
            Timer1.Start()
        End Sub
    
        Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
            intTick += 1
            If intTick > 5 Then intTick = 1
            picCopyAni.Image = imgCopyAni.Images.Item(intTick)
        End Sub
    
    End Class
    A breakpoint in the form_Load confirms it loads just fine, but a breakpoint in the timer event is never tripped and I have no idea why.

    Any help is appreciated.
    Last edited by Mugsy323; May 5th, 2022 at 07:20 PM.

Tags for this Thread

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