Results 1 to 6 of 6

Thread: sizing panels to 50% of form width?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2004
    Posts
    22

    sizing panels to 50% of form width?

    Is there a way to make two panels divide a form by 50% without using code?

    I've tried to do this using the dock, anchor, and dockpadding properties but I can't figure it out

    I placed two panels on a form and set the one
    to dock left and the other to dock right, but when I resize the form the midle doesn't fill out

    I know how to do this using code I just thought that microsoft would of included such a feature. why didn't they just allow you to specify percentages for the width and height properties. Such a feature would alow panels to act as layout managers.

  2. #2
    Member
    Join Date
    Mar 2004
    Location
    Middle of nowhere
    Posts
    45
    That would be to efficient... when people get something that is 100% wonderful, there is no need for upgrades... You will probably by the next version of MS-VS just for the hope that they included that... See...marketing
    Everything great once started with the words "That will never catch on, you shouldnt even bother" be great, go against the crowed, do something stupid, you might become famous.

  3. #3
    New Member
    Join Date
    Mar 2004
    Location
    Indianapolis, IN
    Posts
    6
    http://www.c-sharpcorner.com/Code/20...icDataGrid.asp

    This routine sizes to percentages, I wrote it and use it all the time, it's in C# but you want it let me know and I'll convert it to VB.NET real quick.

  4. #4
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    set one panel to dock right and the other to dock fill. size the one on the right to where u want if before docking the other one.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Mar 2004
    Posts
    22
    Originally posted by thephantom
    set one panel to dock right and the other to dock fill. size the one on the right to where u want if before docking the other one.
    yes I've done that but it doesn't maintain the 50% relationship.

  6. #6
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Originally posted by 00Kevin
    yes I've done that but it doesn't maintain the 50% relationship.
    True, but if you resize the one docked at the left to 50% the other will follow. So by doing it like thephantom said, at least you only need to resize on of them.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

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