Results 1 to 2 of 2

Thread: [2005] timer started on backgroundworker thread

  1. #1

    Thread Starter
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Question [2005] timer started on backgroundworker thread

    i've got a timer that i'm trying to start on a different thread with a backgroundworker. it doesn't work. what am i doing wrong? i tried to invoke the timer but .invoke isn't a member of timer

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] timer started on backgroundworker thread

    Invoke is a member of the Control class. A Timer is not a control. A form is a control.
    vb.net Code:
    1. Private Sub BackgroundWorker1_DoWork(ByVal sender As Object, _
    2.                                      ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
    3.     Me.Invoke(New MethodInvoker(AddressOf Me.Timer1.Start))
    4. End Sub
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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