1 Attachment(s)
[RESOLVED] Split container - issue with extra space when the window is resized
Hi,
First of all let me show you the visual example of my issue.
Attachment 96737
I am using a SplitContainer for separating the window to two parts. The left one contains the browser. And the right contains the controls. But the issue is, when the window is normal size the layout is perfect. But when Maximized, the right pane has some extra space !
How would I clear the issue so that the right pane would embed the TabControl without any extra spaces in between ? I tried fiddling with properties, but couldn't find anything useful. Probably, it's something simple that I am unaware of! :P
Thanks in advance.. :wave:
Re: Split container - issue with extra space when the window is resized
Judging by the fact that we can see the top of a Button at the bottom of your second screen shot, I doubt there is any actual extra space. You've probably just configured the contents in correctly. Is that TabControl inside some other container or is it directly in Panel2 of the SplitContainer? If it's the latter then you should probably be setting its Dock property to Fill.
1 Attachment(s)
Re: Split container - issue with extra space when the window is resized
Quote:
Originally Posted by
jmcilhinney
Judging by the fact that we can see the top of a Button at the bottom of your second screen shot, I doubt there is any actual extra space. You've probably just configured the contents in correctly. Is that TabControl inside some other container or is it directly in Panel2 of the SplitContainer? If it's the latter then you should probably be setting its Dock property to Fill.
Thanks :wave:
No, there isn't a button at the bottom. But it is the StatusStrip, with a ProgressBar in it. The TabControl is inside the second panel. And I have set it's Dock property to Fill now.
Now, the TabControl is a bit extended leave blank space inside it, when maximized! Is that the only way that how it should appear ? I never used SplitContainer before.
See the pic:
Attachment 96741
:wave:
Re: Split container - issue with extra space when the window is resized
This has nothing to do with the SplitContainer. This is simply about resizing and reflowing controls within a container when that container is resized. If you expect a control to resize with its parent then you use the Dock and Anchor properties accordingly. If you expect those GroupBoxes to stretch and shrink as the TabControl stretches and shrinks then you have to set the Anchor properties so that they are anchored to both sides. That would be the same if the TabControl was directly on a form. Likewise, if you expect the controls inside the GroupBoxes to stretch and shrink when the GroupBoxes do then you have to set their Anchor properties too. You might want to follow the CodeBank link in my signature and check out my thread on Dock & Anchor.
Re: Split container - issue with extra space when the window is resized
THanks JM :wave:
I played with the Anchoring and Docking and made the textboxes and some buttons to fill the rest of the space.
It's still a bit confusing on Docking & Anchoring! Should play with it to get more ideas. I think it's somewhat like the Relative positioning of parent and the Absolute positioning of its children, in CSS. :P
Re: Split container - issue with extra space when the window is resized
There's nothing especially complex about Dock and Anchor. Dock allows you to push a control hard up against an edge of its parent. That's it. You can select one edge or all four edges. Anchor allows you to maintain a constant distance between an edge of the child and the adjacent edge of the parent. That's it. You've already got your menu docked to the top and your status bar docked to the bottom and I doubt that that confuses you.
Re: Split container - issue with extra space when the window is resized
Quote:
Originally Posted by
jmcilhinney
There's nothing especially complex about Dock and Anchor. Dock allows you to push a control hard up against an edge of its parent. That's it. You can select one edge or all four edges. Anchor allows you to maintain a constant distance between an edge of the child and the adjacent edge of the parent. That's it. You've already got your menu docked to the top and your status bar docked to the bottom and I doubt that that confuses you.
Thanks :wave: