المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Cross-thread error.



C# Programming
04-13-2009, 07:00 PM
OnActivated()
MethodInvoker one function to initialize the data of the main form. And before beginInvoke, new the progress form B, the Form B to show the progress to the User. And there is a Timer in the form B, if the time is bigger than 2 seconds, the B Form will showdialog itself to forbide user operation. and then if MethodInvoke function finishs the task, it will stop the form B.
then the error shows. "Cross-thread access Form B from the thread is not the thread created by it."


the MethodInvoker is the another thread?