Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

I have an MDI form with ToolStripMenuItem . on the click event of menu items i am initializing a form to load.
The problem i am facing is, since i have lot of menus in the MDI its taking too much time to load MDI.
When i put debug point on the form load event of MDI i realize its going through each and every form.
So how can i prevent this situation.
Please help.


C#
private void headsEntryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Frm_head head = new Frm_head();
            head.MdiParent = this;
            head.Show();
        }
Posted
Updated 8-Aug-15 6:53am
v2

1 solution

ChildForm obj=new ChildForm();
obj.Owner=this;
obj.Show();

// In ChildForm_Load:

private void ChildForm_Load(object sender, EventArgs e)
{
this.Owner.Enabled = false;
}

private void ChildForm_Closed(object sender, EventArgs e)
{
this.Owner.Enabled = true;
}
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900