Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
465
Threading with UltraListView
posted

Hi

After reading hundreds of lines of text about threading and keeping everything thread safe I still do not get the following.

I have created on my main thread Items into a UltraListView, now at another time(not at creation) on another worker thread I want to update a subitem and or the text of the main column. So using a keyIndex linked to the MainColumn Item I use Dim intIndex as Integer = UltraListView1.Items.IndexOf(ItemKey) to return the required index if available. If a valid index is returned then I use Dim clmX as UltraListViewItem = UltraListView1.Items(intIndex) to make a reference to the object. When I need to set the Text property I use the Invoke as required on the clmX and pass it to the correct thread.

Now as I do not get a cross thread error when returning the IndexOf and no error when getting the clmX object is this method classed as thread safe?

Should I be using a Invoke to get the IndexOf or Invoking to get a UltraListViewItem for reference in the Dim?

-Paul