Link to home
Start Free TrialLog in
Avatar of lweekly
lweekly

asked on

VB.Net 2010 Managing MDI forms

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?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lweekly
lweekly

ASKER

The problem was actually with a COM control on the form.  Once I got an updated version of it, all was OK.