Thursday, 8 August 2013

Delegate and thread issue

Delegate and thread issue

I have a thread which uses this loop:
For Each Item As ListViewItem In ListView_Monitor.Items
' do something...
Next Item
That causes a cross-thread operation error when trying to read the Items
collection of the ListView_Monitor
I've tried to write the correct delegate to avoid that error but I'm
missing something and does not work my delegate, so for now I set
CheckForIllegalCrossThreadCalls to False.
Someone can show me how would be the correct delegate for the operation I
need?

No comments:

Post a Comment