Introduction
This Mdi control is look like VS2003, include feature TabTitle, CloseAll, MdiList but not support docking, drag n drop. Any question welcome. This is my first articles and fair english.
Background
My last application use mdi but it always flicker when use Application.EnableVisualStyle() and switch between child form. I search from the internet and found many many. Some control has a lot of code then i decided to created own mdi control(light-weight) and shared to you.
Using the code
Before use this code, ensure to compile before.
Add the control to your VS ToolBox by choose file "asWins.Forms.dll" and select "asMdiManager".
Create a new MainForm and add MainMenu and control "asMdiManager" to MainForm but not set property IsMdiContainer to true because we do not use standard feature.
For all ChildForm must be inherit from class asWins.Forms.BaseForm it has property to allow open dupplicate form.
private bool m_AllowDuplicate;
<summary /></summary />[
DefaultValue(false),
Category("Appearance"),
Description("Allow open more than 1 times.")
]
public bool AllowDuplicate
{
get {return m_AllowDuplicate;}
set {m_AllowDuplicate = value;}
}
In MainForm when click on MenuItem to open child form in the old way we use
private void menuItem3_Click(object sender, System.EventArgs e)
{
DummyForm frm = new DummyForm();
frm.MdiParent = this;
frm.Show();
}
Change to this code.
private void menuItem3_Click(object sender, System.EventArgs e)
{
DummyForm frm = new DummyForm();
this.asMdiManager1.AddForm(frm);
}
it very easy.
License
If you like it pls send postcard to me, see address at menu about.
He start from web developer(asp classic) since 1997, and now use .net techonogy(c#, vb.net).