Hi,
I've a parent form frmParent and a child form frmChild. I open the child form as a modal dialog from the parent form as below --
frmChild.ShowDialog(this);
Now, when the child form is opened, I'm able to move the child form outside the parent form. Is there a way to restrict the Modal form to move within the Parent form ?
Thanks,
Loading

VulpesRank #55 · 29.2K reputationPosted Nov 10, 2011, 4:57 AM EST
What does work is to set the dialog's start position to 'CenterParent' and then handle its WndProc to intercept the SC_MOVE message and prevent it from being moved at all.
If that's of interest, the code is as follows:
// on parent from
// on child form
sasikumar15 reputationPosted Nov 10, 2011, 6:35 PM EST