MDI layout on startup

srd1984

Newcomer
Joined
Jan 7, 2005
Messages
5
Hey,

Having real trouble on my MDI application.

I create two window as follows

Code:
frmSChild objfrmSChild = new frmSChild();
objfrmSChild.MdiParent = this;
objfrmSChild.Show();

		
frmMChild objfrmMChild = new frmMChild();
objfrmMChild.MdiParent = this;
objfrmMChild.Show();

And I have tried to put in a way of having it tiled on startup, but I cant get it to work.

Ideally I want a form that I have created to perform this so that the form appears on startup and the user can choose the layout.

So later I have this to create an instance of the form Layout I already have.

Code:
public void Layout()
{
  frmLayout layout = new frmLayout();
  layout.ParentFormLayout = this;
  layout.ShowDialog();

  if (layout.DialogResult == DialogResult.OK)
  {
    this.LayoutMdi(MdiLayout.TileHorizontal);
  }
  if (layout.DialogResult == DialogResult.Cancel)
  {
    this.LayoutMdi(MdiLayout.TileVertical);
  }
}

But no matter where I place this method it doesnt seem to work.

Even if I add tiling straight after the first code I placed, not even an option just tiling horizontal it doesnt work. I can only do it from the Main Menu when clicking the TileHorizontal from the window tab.

Its driving me crazy!!!

Any help is greatly appreciated
 
Back
Top