This seems to work...
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeCompo nent();
//
// TODO: Add any constructor code after InitializeCompo nent call
//
Control mdic=null;
foreach(Control c in this.Controls)
if(c is MdiClient)
{
mdic=c;
}
this.Controls.R emove(mdic);
TreeView tv=new TreeView();
tv.Location=new Point(0,0);
tv.Size=new Size(100,100);
tv.Dock=DockSty le.Left;
this.Controls.A dd(tv);
this.Controls.A dd(mdic);
mdic.Dock=DockS tyle.Fill;
Form f=new Form();
f.MdiParent=thi s;
f.Show();
f=new Form();
f.MdiParent=thi s;
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***@discussi ons.microsoft.c om> wrote in message
news:44******** *************** ***********@mic rosoft.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?)