teixeira Posted July 19, 2006 Posted July 19, 2006 Hi, I developed an MDI Environment with several MDIchilds and i would like to prevent the same MDIClient open twice. User clicks once and opens 1 mdi client window, user clicks again and if form exists calls BringToFront() method else if not exists, recreate 1 new mdi client wnd again. Until here all rocks, but in the second time e recreate (because doesn't exists anymore) a new mdi client window, an error ocurres, because i have a method that uses BeginInvoke((MethodInvoker) delegate{stuff to change})); inside. The error is about the window handle... How can i prvent this to error, but saving my need of show a single form? Thanks in advance Quote
teixeira Posted July 19, 2006 Author Posted July 19, 2006 I got this answer my self testing more. So the way i found to solve this issue, was EXPLICITLY unregister the event handler at form closed method. I worked, and it seems to me that the cause of all this, was because i use a paralel thread with a pooling of 200ms and at the time i wanted to create the new window maybe the handle wasn't yet created when thread wanted access it. Thanks, Tiago Teixeira Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.