Results 1 to 7 of 7

Thread: [RESOLVED] Split container - issue with extra space when the window is resized

  1. #1

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Resolved [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.

    Name:  error_size.jpg
Views: 1357
Size:  86.6 KB

    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..

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Split container - issue with extra space when the window is resized

    Quote Originally Posted by jmcilhinney View Post
    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

    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:

    Name:  error_2.png
Views: 1403
Size:  27.4 KB


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Split container - issue with extra space when the window is resized

    THanks JM

    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

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Split container - issue with extra space when the window is resized

    Quote Originally Posted by jmcilhinney View Post
    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

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width