title: VB.net Thread safe method to add a listview subitem?
body: <p>I am trying to add a subitem to a listview in a threadsafe manner.</p>
  
  <p>In a single threaded application it works like so:</p>
  
  <pre><code>    For i As Integer = 0 to lvMembers.Items.Count - 1
      Dim lv As ListViewItem = lvMembers.Items(i)
      Dim str As String = lv.Text.ToString
      If str.Contains("value")
      lv.SubItems.Add("OK")
      lv.SubItems(0).ForeColor = Color.Green
  
      Else
      lv.SubItems.Add("FAILED")
      lv.SubItems(0).ForeColor = Color.Red
  
      End If
      Next
  </code></pre>
  
  <p>However if run in another thread it causes a cross threading error.</p>
  
  <p>I have looked at examples of delegate subs that use Invoke, but all examples i have seen involve updating the text property of an object, and i cant get my head round how to apply the concept to actually add a subitem to a listview.</p>
  
  <p>Any help very much appreciated.</p>