Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27034

BGW report progress stuck

$
0
0
hi i am dropping items on to a panel and running a BGW im getting no issue but nothing is happening and the BGW never stops

on the drop panel drag drop event i have

vb Code:
  1. Private Sub filespanel_DragDrop(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles filespanel.DragDrop
  2.         theFiles = CType(e.Data.GetData("FileDrop", True), String())
  3.  
  4.  
  5.  
  6.         For Each theitems As String In theFiles
  7.  
  8.             item_list.Add(theitems)
  9.  
  10.         Next
  11.  
  12.  
  13.         Using dialogue As New frmPleaseWait(AddressOf BackgroundWorker_DoWork,
  14.                                               AddressOf BackgroundWorker_ProgressChanged,
  15.                                               AddressOf BackgroundWorker_RunWorkerCompleted)
  16.  
  17.             Me.Show_waitscreen(dialogue)
  18.  
  19.         End Using
  20.  
  21.  
  22.     End Sub


do work
vb Code:
  1. Private Sub BackgroundWorker_DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs)
  2.         Dim worker = DirectCast(sender, BackgroundWorker)
  3.         Dim myArray As String() = item_list.ToArray()
  4.  
  5.         For Each item As String In myArray
  6.  
  7.             worker.ReportProgress(item)
  8.             Thread.Sleep(1000)
  9.  
  10.         Next
  11.  
  12.     End Sub


report progress
vb Code:
  1. Private Sub BackgroundWorker_ProgressChanged(ByVal sender As Object, ByVal e As ProgressChangedEventArgs)
  2.  
  3.         Copy_control(DirectCast(e.UserState, String))
  4.  
  5.     End Sub

Viewing all articles
Browse latest Browse all 27034

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>