Click here to Skip to main content
Click here to Skip to main content

Mdi Manager VS2003 Style

, 24 May 2007 CPOL
Rate this:
Please Sign up or sign in to vote.
Good choice for replace default mdi
Screenshot - asMdiManager.jpg

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 />/// Allow open more than 1 times. 
/// 
</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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

v# guy
Software Developer
Thailand Thailand
He start from web developer(asp classic) since 1997, and now use .net techonogy(c#, vb.net).

Comments and Discussions

 
Generalform.show() flicker PinmemberVincent_ws14-Aug-07 19:20 
GeneralRe: form.show() flicker PinmemberMarcus Deecke17-Aug-07 11:56 
GeneralRe: form.show() flicker PinmemberVincent_ws19-Aug-07 15:59 
GeneralRe: form.show() flicker PinmemberV# Guy18-Aug-07 0:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.141022.2 | Last Updated 25 May 2007
Article Copyright 2007 by v# guy
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid