Tell original Thread that new thread is done working?

L

Lars Netzel

I have a ListView in my application. It is populated on Form_Load thru a For
Each Loop and in the loop I add a Button to a cell on each row. This works
perfect.

I have an update button beside the ListView that, when clicked, starts a
new thread that reads thru a bunch of files and emails.. and when this is
done it repopulates the ListView.
But when it's called from this thread it crashes on adding the buttons do
not ask me why but the error is... "Controls created on one thread cannot be
parented to a control on a different thread."

So what I want to do is to NOT repopulate the ListView from this thread but
instead tell the original Thread to populated the ListView.

How can this be done or can I get around this some other way?

/
Lars Netzel
 
L

Lars Netzel

Thank you.. I did thry that Invoke stuff.. that took away the crash I got..
but I'm still not sure if the thread is acting the way it shoudl cause
something is taking a long time that shouldn't-- oh well... I have no
crash... thank you

/lars
 

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