Threadsafe control wrapper

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Has anyone implemented a threadsafe UserControl or Form wrapper? I want to
provide an easy way of calling in to a windows forms control from a worker
thread without having to declare loads of delegates in the worker thread.

Regards
 
Gravy said:
Hi,

Has anyone implemented a threadsafe UserControl or Form wrapper? I want to
provide an easy way of calling in to a windows forms control from a worker
thread without having to declare loads of delegates in the worker thread.

Such a wrapper would have to wrap every single Form or UserControl property.

The better idea is to isolate the interface for updating your UI so that you
don't have you background thread randomly touching the UI. Once you've got
that narrowed down to a smaller number of UI-affecting methods, it won't be
so difficult to use delegates for Invoke.

John Saunders
 
Back
Top