Results 1 to 40 of 91

Thread: Using the BackgroundWorker Component

Threaded View

  1. #11
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: Using the BackgroundWorker Component

    Hi John ,

    here you what i have done

    Code:
       Private Sub bgwkdata_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles bgwkdata.DoWork
          
      If bgwkdata.CancellationPending Then
    
                e.Cancel = True
    
                Exit Sub
    
            End If
    
    //my boucle here
    
     If bgwkdata.CancellationPending Then
    
                e.Cancel = True
    
                Exit Sub
    
            End If
    and on btnstop :

    Code:
    Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click
    
    
            bgwkdata.CancelAsync()
    
    
    
    
    
    
        End Sub
    Edit : i get it to work i placed the code in the boucle

    Thanks
    Last edited by killer7k; Nov 1st, 2008 at 11:53 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