Read up on Control.BeginInvoke (and .Invoke) in the docs (not to be confused
with Delegate.BeginInvoke and .Invoke).

These methods, which are inherited by all winforms elements (forms,
controls, etc) are specifically designed to supporting updating UI elements
in a forms app from the 'wrong' thread.

In addition to the samples you'll find the docs/sdk, I have a couple on my
site that demonstrate the usage model:

http://www.bearcanyon.com/dotnet/#AsyncControlUpdates
http://www.bearcanyon.com/dotnet/#MultithreadingHazards

Then if you have follow up questions, check the archives of DevelopMentor's
DOTNET-WINFORMS list
(http://discuss.develop.com/archives/dotnet-winforms.html).  If your
question hasn't already been asked & answered, then post your follow up to
that list.

-Mike
http://www.bearcanyon.com

> problem:
> when this method is being executed, I want to be able to update a
> listview. this listview is of course on the Winform, but since A was
> created on a diff. thread, I can't update the listview control !!
>

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to