This seems to work...
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
Control mdic=null;
foreach(Control c in this.Controls)
if(c is MdiClient)
{
mdic=c;
}
this.Controls.Remove(mdic);
TreeView tv=new TreeView();
tv.Location=new Point(0,0);
tv.Size=new Size(100,100);
tv.Dock=DockStyle.Left;
this.Controls.Add(tv);
this.Controls.Add(mdic);
mdic.Dock=DockStyle.Fill;
Form f=new Form();
f.MdiParent=this;
f.Show();
f=new Form();
f.MdiParent=this;
f.Show();
}
--
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"Craig" <Cr***@discussions.microsoft.com> wrote in message
news:44**********************************@microsof t.com...
Is it possible to restrict where an mdi form can go within the parent
form....for example, what if I wanted the parent form to have a panel with
a
listbox on the left hand side of the form......would it be possible to
somehow code it so that any mdi forms would not be allowed to be dragged
over
the panel. (Or when cascaded, the mdi forms wouldn't overlap the panel?)