I have an application that allows multiple MDI children to be opened at a time. I added a button to each to allow them to be "un-docked" or "emancipated" from the MDI parent, in case the user wants to move it to another part of the screen or re-size it outside of the MDI container form. To do this I set Me.mdiparent=Nothing on the Child form.
This works fine.
I also added a button to "move back in" with the parent form. Basically, re-establish the MDI relationship.
I simply set Me.MdiParent=frmParent. This appears to work and sometimes does OK. But more often than not, the program soon crashes with the following error message:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Am I trying to do something that can't be done?
If it can be done, how do I code the two moves?
If not, any suggestions as to working around the problem?