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. C#
  4. splitContainer control

splitContainer control

Scheduled Pinned Locked Moved C#
dockerworkspace
7 Posts 3 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.
  • J Offline
    J Offline
    JollyMansArt
    wrote on last edited by
    #1

    Is there a split container control that will allow the user the ability to resize the control during the applications runtime environment. And will allow for more than 2 split panels. As the SplitContainer control I can only see it allowing 2 containers. I need at least 3 or 4 containers to be resizable. Without having to next the containers inside each other.

    L D 2 Replies Last reply
    0
    • J JollyMansArt

      Is there a split container control that will allow the user the ability to resize the control during the applications runtime environment. And will allow for more than 2 split panels. As the SplitContainer control I can only see it allowing 2 containers. I need at least 3 or 4 containers to be resizable. Without having to next the containers inside each other.

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      AFAIK nesting SplitContainers is the normal approach. The alternative could be a TableLayoutPanel, but then IMO you have to organize the resizing handles and everything yourself. :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


      I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


      J 1 Reply Last reply
      0
      • L Luc Pattyn

        AFAIK nesting SplitContainers is the normal approach. The alternative could be a TableLayoutPanel, but then IMO you have to organize the resizing handles and everything yourself. :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


        I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


        J Offline
        J Offline
        JollyMansArt
        wrote on last edited by
        #3

        Thanks, That is what I figured :(... As that was the only way I could get it to work and drop the margins to maximize used space. Quick question though... On this control how to you fix 1 of the partitions sizes to a minimum size. Here is what I tried but it is not working.

        if (scRPTFilter1.Panel2.Height != 275)
        {
        scRPTFilter1.Panel2.Height = 275;
        }
        if (scRPTFilter1.Panel2.Width != 557)
        {
        scRPTFilter1.Panel2.Width = 557;
        }

        I was thinking I needed to say something like

        if (scRPTFilter1.Panel2.Height != 275)
        {
        scRPTFilter1.Panel2.Height = new size(275, scrptfilter1.panel2.width);
        }

        Just Not Sure since the height is separated here.

        L 1 Reply Last reply
        0
        • J JollyMansArt

          Thanks, That is what I figured :(... As that was the only way I could get it to work and drop the margins to maximize used space. Quick question though... On this control how to you fix 1 of the partitions sizes to a minimum size. Here is what I tried but it is not working.

          if (scRPTFilter1.Panel2.Height != 275)
          {
          scRPTFilter1.Panel2.Height = 275;
          }
          if (scRPTFilter1.Panel2.Width != 557)
          {
          scRPTFilter1.Panel2.Width = 557;
          }

          I was thinking I needed to say something like

          if (scRPTFilter1.Panel2.Height != 275)
          {
          scRPTFilter1.Panel2.Height = new size(275, scrptfilter1.panel2.width);
          }

          Just Not Sure since the height is separated here.

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Hi, 1. Control.Height and Control.Width are existing properties, you can get and set them. Control.Size is also a property, you can get and set it, however setting it requires a new Size, it does not make sense to set either Control.Size.Height or Control.Size.Width, since that will change the H or W of the copied size, not the Control's actual Size. 2. I haven't done such things with SplitContainer (I used it only once), it probably works just fine. 3. If you want to enforce a minimum W or H, you should test for < and not for equality, otherwise you can't change it at all. :)

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


          I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


          J 1 Reply Last reply
          0
          • L Luc Pattyn

            Hi, 1. Control.Height and Control.Width are existing properties, you can get and set them. Control.Size is also a property, you can get and set it, however setting it requires a new Size, it does not make sense to set either Control.Size.Height or Control.Size.Width, since that will change the H or W of the copied size, not the Control's actual Size. 2. I haven't done such things with SplitContainer (I used it only once), it probably works just fine. 3. If you want to enforce a minimum W or H, you should test for < and not for equality, otherwise you can't change it at all. :)

            Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


            I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


            J Offline
            J Offline
            JollyMansArt
            wrote on last edited by
            #5

            I just need to know how to enforce 1 panel's minimum size.

            L 1 Reply Last reply
            0
            • J JollyMansArt

              I just need to know how to enforce 1 panel's minimum size.

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              well, try if (pan.Width<minWidth) pan.Width=minWidth; and similar for height inside its Resize, SplitterMoving and/or SplitterMoved handler. And/or read up on those events. :)

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


              I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


              1 Reply Last reply
              0
              • J JollyMansArt

                Is there a split container control that will allow the user the ability to resize the control during the applications runtime environment. And will allow for more than 2 split panels. As the SplitContainer control I can only see it allowing 2 containers. I need at least 3 or 4 containers to be resizable. Without having to next the containers inside each other.

                D Offline
                D Offline
                dybs
                wrote on last edited by
                #7

                Hi, A colleague and I came across this same problem and made a control derived from TableLayoutPanel, implementing the MouseDown, MouseMove and MouseUp events. It works reasonably well, except for designer support - we have to add all the controls via code. Dybs

                The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen

                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