R
Reinhold Schalk
Hello,
i have the following problem: i'm trying to modify UI controls from a long
running worker thread. The thread function itself is a method of my Form
class. Now i wanted to use Control.Invoke() to change the current thread
context to the UI thread for updating my controls. I use a custom delegate
delegate void MethodCaller();
My thread functions looks like:
private void AsyncInitializeData() {
MethodCaller method = new MethodCaller(InitializeData);
...
this.Invoke(method); // throws ArgumentException
...
}
private void InitializeData() {
...
}
The call to Control.Invoke(Delegate); does always throw a ArgumentException
without additional info.
I do not know what's going on.
Any help is appreciated.
Thanks in advance
Reinhold
i have the following problem: i'm trying to modify UI controls from a long
running worker thread. The thread function itself is a method of my Form
class. Now i wanted to use Control.Invoke() to change the current thread
context to the UI thread for updating my controls. I use a custom delegate
delegate void MethodCaller();
My thread functions looks like:
private void AsyncInitializeData() {
MethodCaller method = new MethodCaller(InitializeData);
...
this.Invoke(method); // throws ArgumentException
...
}
private void InitializeData() {
...
}
The call to Control.Invoke(Delegate); does always throw a ArgumentException
without additional info.
I do not know what's going on.
Any help is appreciated.
Thanks in advance
Reinhold