Results 1 to 5 of 5

Thread: Background Worker or New Thread?

  1. #1

    Thread Starter
    Lively Member Shardox's Avatar
    Join Date
    Nov 2006
    Location
    Barcelona, Spain
    Posts
    123

    Question Background Worker or New Thread?

    Hi guys,

    My application is making the user wait while printing documents due to the logon issues of Crystal Reports. I am not used to work with threads so I am asking you for advice. Should I use background worker or should I programmatically start a new thread? I don't know, maybe background worker starts a new thread itself. Thanks in advance!!

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Background Worker or New Thread?

    it does

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

    Re: Background Worker or New Thread?

    When you call the RunWorkerAsync method of a BackgroundWorker it raises its DoWork event on a thread pool thread.
    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

  4. #4

    Thread Starter
    Lively Member Shardox's Avatar
    Join Date
    Nov 2006
    Location
    Barcelona, Spain
    Posts
    123

    Re: Background Worker or New Thread?

    Thank you!

  5. #5
    Hyperactive Member cptHotkeys's Avatar
    Join Date
    Apr 2007
    Location
    New Zealand
    Posts
    294

    Re: Background Worker or New Thread?

    Use the background worker, as that will handle all the delegates you need if you want to access the form to update some user interface items ect in the ProgressChanged event, there is also the work complete event. If you use a thread you will have to create delegates and invoke each control you want to access.

    Signatures suck

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