Stupid Forms Tricks!
Wow. I've just learned something that should be a no-brainer. It's not like this has happened that often, but there have been a few times that I've tried to use a StatusStrip control in a UI (Dock = Bottom) with some other control filling the rest of the form (Dock=Full). I've always given up since the Fill control always goes behind the StatusStrip (presumably any Dock=Bottom control). My "solution" has been to eliminate the docking and size the larger control explicitly above the StatusStrip, then anchor it in all directions. Not a great solution.
Figure 1:Notice the anchor handles (of the Fill component) at the bottom
The solution to this dilemma is so simple I'm just kicking myself! It turns out that all you need to do (with both controls docked properly) is select the Fill control and bring it to front. That's it:
Figure 2: The "Bring to Front" button
Not the larger control is properly set in z-order.
Figure 3: Now the anchor handles are in the right place!
Thought I've searched for a better solution in the past, I've always given up before finding it. Lo and behold, this was my lucky day!
Source: http://www.tek-tips.com/viewthread.cfm?qid=1457018&page=3
1 Comment
David Hogue said
Nice tip, I'll have to remember that.<br /><br />I used to get around this in a different way: I found out the the order of the docked elements in the generated code controlled which was docked to what. So I would go and cut and paste some of the generated code and things would work. <br /><br />This should be much easier. I wonder if the bring to front button just does the same thing behind the scenes.