Regain form instance from handle
Posted on 2006-05-16
Is there any way to create and instance of a form from a handle?
Form myForm = new Form();
IntPtr ptr = myForm.handle;
//This is where I would like to be able to create an instance of that form so that I can regain managed control of the form. The IntPtr is used as a holder for a particular form. When created, the handle is stored in the IntPtr. Later on when an instance of that form is created, if the IntPtr is holding a value, I would like to pull that instance and make it active instead of creating another instance. So can an instance of a form be created from an Handle?
Form anotherform = ptr;