"Justin" <Ju****@NoSpam.com> schrieb:
I'm a newbie to threads. I can run
"comboProfiles_SelectedIndexChanged(sender, e)" from any normal sub in my
project however if I run this from within a new thread I've started it
doesn't like "sender" or "e". I know sending info from within a thread is
different but what I'm doing should be simple so if someone can help me
out
First, I would rethink if calling an event handler is really the best
solution.
Second, don't forget that Windows Forms controls' instance members are not
safe for multithreading.
Third, you can use
'Control.Invoke'/'Control.BeginInvoke'/'Control.InvokeRequired' to call a
method in the context of the main UI thread from within a secondary thread:
Multithreading in Windows Forms-Anwendungen
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=multithreading&lang=de>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>