?
Solved

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

Posted on 2008-11-01
5
Medium Priority
?
394 Views
Last Modified: 2008-11-02
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
Comment
Question by:chrisbray
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 30

Accepted Solution

by:
Alexandre Simões earned 2000 total points
ID: 22856297
"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
 
LVL 3

Author Comment

by:chrisbray
ID: 22857236
Hi AlexCode:

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

Chris Bray
0
 
LVL 3

Author Comment

by:chrisbray
ID: 22858458
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
 
LVL 30

Expert Comment

by:Alexandre Simões
ID: 22859840
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
 
LVL 3

Author Comment

by:chrisbray
ID: 22861639
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question