Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross-thread operation error with BackgroundWorker

Status
Not open for further replies.

Tve

Programmer
May 22, 2000
166
FR
Hi,

I am getting the 'Cross-thread operation error' when running a backgroundworker. I googled around and did a search here in the forum and I understand a trhead cannot write to another.

The thing is I do not want to write, but actually only read.

I want the backgroundworker to loop on a ListView and retreive displayed items, not write.

If I am doing something wrong, would somebody be kind enough to put me on the right track.



AD AUGUSTA PER ANGUSTA

Thierry
 
Hi Thierry,

The ListView lives within the UI thread. You cannot access this directly from any other thread or you will run into problems.

You can Invoke onto the UI thread from any otherthread - there's plenty examples of that in this forum. Post back if you're having problems.

Hope this helps,

Graeme

"Just beacuse you're paranoid, don't mean they're not after you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top