Listview in thread

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi at all,

I'm trying to refresh items of a ListView that is in a Form. The form is
executed in a separate Thread. I'm using a delegate to refresh ListItems but
I'm not able to do this.

In which mode can I refresh Items of a ListView???

Example code:

Declaration of delegate:
Private Delegate Sub Deleg(ByVal bytesTotal As Decimal, ByVal
bytesTransferred As Decimal, ByVal FileLocal As String)

Execution of delegate:
Dim DelAA As New Deleg(AddressOf Me.UpgrAv)
DelAA.Invoke(bytesTotal, bytesTransferred, FileLocal)

Sub-rutine that refreshs the ListView:
Private Sub UpgrAv(ByVal bytesTotal As Decimal, ByVal bytesTransferred
As Decimal, ByVal FileLocal As String)
lvDownloads.Items(0).Text = CType((bytesTransferred / bytesTotal) *
100, Integer).ToString & " %"
End Sub

Thanks!!!
 
Back
Top