Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. Problem in resizing controls.

Problem in resizing controls.

Scheduled Pinned Locked Moved Windows Forms
helptutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    priyamtheone
    wrote on last edited by
    #1

    Hi, we all know how to dock or anchor controls so that they resize themselves accordingly when a form is resized. It works fine till we have rows of controls on left and right size of the form. But what if have three columns (Columns as in visual sense. I'm not talking about any column control containing other controls) of controls? For example a form having a bunch of controls in the left side, a bunch in the middle and a bunch in the right. There may be a few more bunches in the middle. Now while resizing the form, I want the controls to resize accordingly as well as change their positions to make space for the previous bunch of controls that are resizing. I mean, while the user increases the form size horizontally, the controls of the second bunch should resize and at the same time they should move right because the controls of the first bunch are increasing horizontally too. When the user decreases the form size horizontally the same thing should occur in the reverse order. I can manage it somehow using nested splitcontainers but that's too cumbersome. I would like to know if there's some better way to achieve it, like setting some property etc.? Please help. Please feel free to ask if my post isn't comprehensible. Regards.

    M 1 Reply Last reply
    0
    • P priyamtheone

      Hi, we all know how to dock or anchor controls so that they resize themselves accordingly when a form is resized. It works fine till we have rows of controls on left and right size of the form. But what if have three columns (Columns as in visual sense. I'm not talking about any column control containing other controls) of controls? For example a form having a bunch of controls in the left side, a bunch in the middle and a bunch in the right. There may be a few more bunches in the middle. Now while resizing the form, I want the controls to resize accordingly as well as change their positions to make space for the previous bunch of controls that are resizing. I mean, while the user increases the form size horizontally, the controls of the second bunch should resize and at the same time they should move right because the controls of the first bunch are increasing horizontally too. When the user decreases the form size horizontally the same thing should occur in the reverse order. I can manage it somehow using nested splitcontainers but that's too cumbersome. I would like to know if there's some better way to achieve it, like setting some property etc.? Please help. Please feel free to ask if my post isn't comprehensible. Regards.

      M Offline
      M Offline
      Manfred Rudolf Bihy
      wrote on last edited by
      #2

      You'll might want to look at this: http://msdn.microsoft.com/en-us/library/system.windows.forms.tablelayoutpanel.aspx[^] and also this: http://stackoverflow.com/questions/1142873/winforms-tablelayoutpanel-adding-rows-programatically[^]. Hope that helps you!

      P 1 Reply Last reply
      0
      • M Manfred Rudolf Bihy

        You'll might want to look at this: http://msdn.microsoft.com/en-us/library/system.windows.forms.tablelayoutpanel.aspx[^] and also this: http://stackoverflow.com/questions/1142873/winforms-tablelayoutpanel-adding-rows-programatically[^]. Hope that helps you!

        P Offline
        P Offline
        priyamtheone
        wrote on last edited by
        #3

        I worked with TableLayOutPanel till late last night. Though it's time consuming but it resolved my issue. Thanks a lot. :thumbsup:

        M 1 Reply Last reply
        0
        • P priyamtheone

          I worked with TableLayOutPanel till late last night. Though it's time consuming but it resolved my issue. Thanks a lot. :thumbsup:

          M Offline
          M Offline
          Manfred Rudolf Bihy
          wrote on last edited by
          #4

          Great if you got it to work. I've used the same for a control that needed very specialized resizing requirements.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups