Listview in thread

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!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top