0

I'm having an issue with resizing. I have a Form that is an MDIParent, and then another form that docks inside of it as an MDIChild (also has docked taskbars to the left,right, and above). My issue is that when I add another form inside the MDIParent form, it initially takes on the size that it was built with, even though I have it set to dock-fill.

However, once I RESIZE the parent form, it snaps back to the size it's supposed to be, and stays there... until I add another form, which begins the whole process over.

Is there any way I can call the 'Resize' event handler for my MDI Parent? Or is there anyway I can re-draw the new form MDIChild after it's been loaded? I know I can do something like..

MdiParent.Height ++;
MdiParent.Height --;

and that resizes my parent form, which in turn forces the inside MDIChild to snap to it's correct dimensions.

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
Chris Hobbs
  • 745
  • 2
  • 9
  • 27
  • 2
    The Dock property is meaningless to MDI child windows, don't use it. You "dock" a child window by setting its WindowState to Maximized. – Hans Passant Jan 06 '15 at 23:32
  • I gave that a shot and I'm still having the same issues... anything else obvious likethatI could be missing? – Chris Hobbs Jan 07 '15 at 03:27
  • A form does not `Dock.Fill`. This is something controls do. What you want is to override the `OnLoad()` of the mdi child and set `WindowsState` to maximized. – John Alexiou Jan 07 '15 at 04:53
  • possible duplicate of [Maximize MDI child form](http://stackoverflow.com/questions/8765088/maximize-mdi-child-form) – John Alexiou Jan 07 '15 at 04:53
  • I'll check out that thread - thanks for answering! I removed all references to the DockStyle and set it up to be maximized, and it still was giving me the same issues... anything else obvious I could be missing? – Chris Hobbs Jan 07 '15 at 05:01

0 Answers0