Gomez said:
When I call a method by remoting I get the following exception-
"Control 'conrolname' accessed from a thread other than the thread it was
created on"
Can someone advise how to cope with that provided that I must use this
call somehow?
You can transfer control from the remoting thread into the thread that
created the control by means of the method "Invoke" that all controls have.
For instance, if you are doing theControl.theProperty=theValue; in your
remoted method, you can replace it with this:
theControl.Invoke(new MethodInvoker(myMethod));
...
private void myMethod()
{
theControl.theProperty=theValue;
}
Of course, there are many ways to write the preceding, such as using an
anonymous method inside the call to Invoke instead of the separate myMethod.
This would let you 'capture' theValue instead of passing it around in a
member value as would be required by the previous code example.