Hello
I want to get the value of a property of a control from a thread other than the
thread the control was created on, as far as I can see this is not the same as
invoking an operation on a control on a different thread I have used the
following code as per the guidance in the msdn documentation to invoke an
operation on a control from a thread other than which it was created
delegate void SetFormCursorCallback(Cursor cursor);
private void SetFormCursor(Cursor cursor)
{
if (this.InvokeRequired)
{
SetFormCursorCallback d = new
SetFormCursorCallback(SetFormCursor);
this.Invoke(d, new object[] { cursor });
}
else
{
this.Cursor = cursor;
}
}
What would I do if I wanted to access the Cursor property of the form and return
it to the caller on a different thread?
What techniques can I employ to do this?
Is there a way to make a synchronous call using a delegate that executes on a
different thread and then returns a value to the calling thread?
Thank you
Alex