P
Pug Fugly
I am unable to call the .Show() method on a form that I have passed
through .BeginInvoke as the AsyncState parameter. I can get back the
form correctly after the .EndInvoke is called in the callback, but the
process still seems to be on a different thread even though the
..EndInvoke finished running. I get "Controls created on one thread
cannot be parented to a control on a different thread." Which I know
is not allowed, but I thought once .EndInvoke is done running I should
be back to the original thread. The form is a module variable so it
is not a scope problem. The only way I can get the form to show is if
I create a delegate for the .Show() and call that with .Invoke(). But
after that, I cannot bind to it's datagrid because I get the same
error as above. It seems like I never return back to the same thread,
or the threads are never aborting. What am I missing here?
Thanks,
Slavisa
through .BeginInvoke as the AsyncState parameter. I can get back the
form correctly after the .EndInvoke is called in the callback, but the
process still seems to be on a different thread even though the
..EndInvoke finished running. I get "Controls created on one thread
cannot be parented to a control on a different thread." Which I know
is not allowed, but I thought once .EndInvoke is done running I should
be back to the original thread. The form is a module variable so it
is not a scope problem. The only way I can get the form to show is if
I create a delegate for the .Show() and call that with .Invoke(). But
after that, I cannot bind to it's datagrid because I get the same
error as above. It seems like I never return back to the same thread,
or the threads are never aborting. What am I missing here?
Thanks,
Slavisa