Naweez
Naweez

Reputation: 313

child form minimize goes to task bar

I have an MDI form which displays a treeView control, when the user clicks on the tree node child form, it opens:

private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
    frmPartMaster frm = new frmPartMaster();
    frm.Show();
}

Here frm is displaying the backside of the tree control but I want it to show form in front of parent, not back. So I changed the code to:

private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
    frmPartMaster frm = new frmPartMaster();
    frm.Show(this);
}

Here the child form is displayed in front of the tree, but when I minimize the child form it goes to task bar.How do I get it to go to the left corner of of parent form?

Upvotes: 2

Views: 1014

Answers (3)

David Heffernan
David Heffernan

Reputation: 612964

Real MDI child forms do not minimize to the taskbar. Therefore I can only conclude that you are not using an MDI child form and that your solution is to start doing so.

Upvotes: 0

Mayank
Mayank

Reputation: 1631

You have to set the parent form's IsMdiContainer property to true. Then while opening the child form add the following code:

frm.MdiParent = this;

Upvotes: 2

Anuraj
Anuraj

Reputation: 19598

Are you using MDI? Then it won't come to Task bar. You can set the ShowInTaskbar option to false, which will not display for in Taskbar.

Upvotes: 0

Related Questions