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
do work
report progress
on the drop panel drag drop event i have
vb Code:
Private Sub filespanel_DragDrop(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles filespanel.DragDrop theFiles = CType(e.Data.GetData("FileDrop", True), String()) For Each theitems As String In theFiles item_list.Add(theitems) Next Using dialogue As New frmPleaseWait(AddressOf BackgroundWorker_DoWork, AddressOf BackgroundWorker_ProgressChanged, AddressOf BackgroundWorker_RunWorkerCompleted) Me.Show_waitscreen(dialogue) End Using End Sub
do work
vb Code:
Private Sub BackgroundWorker_DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs) Dim worker = DirectCast(sender, BackgroundWorker) Dim myArray As String() = item_list.ToArray() For Each item As String In myArray worker.ReportProgress(item) Thread.Sleep(1000) Next End Sub
report progress
vb Code:
Private Sub BackgroundWorker_ProgressChanged(ByVal sender As Object, ByVal e As ProgressChangedEventArgs) Copy_control(DirectCast(e.UserState, String)) End Sub