J
Jeronimo Bertran
Hello,
I have an splash window application that creates a form from one thread
(call it formSplash) and runs it and later on a differnt thread a new form
(mainForm) is created and I want to make mainForm the owner of formSplash
so that it appears behind.
Using VS2003 I was able to do this by simply setting the Owner member of
the splashForm from the mainForm thread. With .net 2.0 I get the following
error:
Cross-thread operation not valid: Control 'formSplash' accessed from a
thread other than the thread it was created on.
I then used formSplash.Invoke to call a method that would set the variable
and passed it the mainForm as a parameter but when I assign it to the Owner
member variable I now get the following error:
Cross-thread operation not valid: Control 'mainForm' accessed from a thread
other than the thread it was created on.
I hope I was able to explain the problem correctly...
Thanks
Jeronimo
I have an splash window application that creates a form from one thread
(call it formSplash) and runs it and later on a differnt thread a new form
(mainForm) is created and I want to make mainForm the owner of formSplash
so that it appears behind.
Using VS2003 I was able to do this by simply setting the Owner member of
the splashForm from the mainForm thread. With .net 2.0 I get the following
error:
Cross-thread operation not valid: Control 'formSplash' accessed from a
thread other than the thread it was created on.
I then used formSplash.Invoke to call a method that would set the variable
and passed it the mainForm as a parameter but when I assign it to the Owner
member variable I now get the following error:
Cross-thread operation not valid: Control 'mainForm' accessed from a thread
other than the thread it was created on.
I hope I was able to explain the problem correctly...
Thanks
Jeronimo