Results 1 to 4 of 4

Thread: VB.NET 2005 - Function based on timer.

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2010
    Location
    Ontario, Canada
    Posts
    55

    VB.NET 2005 - Function based on timer.

    I can't seem to get one of my functions to work based on a timer. Every tick of the timer, I'm trying to call a function which will start periodically taking screen shots until the 'Finish' button is pressed. However, I've run into numerous errors and wondered if anyone could give me any insight or suggestions. Here is what I have so far...

    Code:
    Public Class Form1
    
        Dim ssTimer1 As Timer
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Me.ssTimer1.Enabled = False
        End Sub
    
        Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
    
            ssTimer1.Interval = 10000
            ssTimer1.Enabled = True
    
            AddHandler ssTimer1.Tick, AddressOf RunAC
    
        End Sub
    
        Public Sub RunAC()
            < yata yata yata code code code>
        End Sub
    End Class
    One of the errors included "Public Sub RunAC() does not have the same signature as delegate". This might be really obvious, I'm a recent Computer Programmer / Analyst graduate with intermediate VB.net experience. Any help is appreciated.
    Last edited by stronius; Feb 9th, 2010 at 10:03 AM.

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