Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 397
  • Last Modified:

How can I add a panel to an MDI form, but stop child forms being created behind it?

I have an MDI parent form with a MainMenu, a ToolStrip, and a StatusBar.  I want to add a panel to the left of the main form to host buttons (like the Outlook SideBar).

If I do not dock the panel child windows are created behind the panel.  If I do dock the panel the menu, tool strip and status bar move to the left of the panel.

I want the panel to be docked left in the space between the existing components, and to automatically adjust in size if any or all of those components are hidden.  Anyone got any suggestions?

Chris Bray
0
chrisbray
Asked:
chrisbray
  • 3
  • 2
1 Solution
 
Alexandre SimõesManager / Technology SpecialistCommented:
"If I do not dock the panel child windows are created behind the panel."
True, there's nothing we can do about this one. Every control directly added to an MDI always appear on top of any form.

"If I do dock the panel the menu, tool strip and status bar move to the left of the panel."
This is due controls ordering. Try right-clicking the panel and choosing "Bring to Front" or "Sent To Back". Play with it a bit until you have set the correct controls z-order. You can also do it on the ToolStrip or any other control.
0
 
chrisbrayAuthor Commented:
Hi AlexCode:

That was the first thing I tried.  Makes no difference whatsoever...

Chris Bray
0
 
chrisbrayAuthor Commented:
Hi AlexCode:

Following on from your suggestion I tried it again, and guess what?  This time it worked!!

Thanks, don't know why it didn't work when I tried it before... points are yours.

Chris Bray
0
 
Alexandre SimõesManager / Technology SpecialistCommented:
Thanks,
it had to work as I have never had that kind of trouble between a panel and a toolstrip so I made a small test before actually posting the answer.

Cheers,
Alex
0
 
chrisbrayAuthor Commented:
Hi AlexCode:

Well, I definitely tried it first....  I also tried removing and adding back the components because I have known that to solve z order problems too.  Nothing I tried worked so I posted the question, and when I tried it again after your advice it worked!

I must have done something different or done it in some other order - trouble is I don't know what.  Still, next time I will know to keep trying until it odes work.

Chris Bray
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now