splitter problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    splitter problems

    Hi,
    I have a group of controls in a panel on the right-hand side of a
    splitter and a treeview on the left-hand side.
    The only configuration that I can find to make the right-hand side
    resize correctly is:

    lhsTreeview - Dock = Fill, Anchor = Top,Left
    splitter - Dock = Right
    rhsPanel - Dock = Right, Anchor = Top,Left

    The problem is that resizing the form repositions the splitter, making
    the the left-hand side treeview grow, I would rather that the splitter
    not reposition, resulting in the right-hand side growing.

    What settings should be changed to make this happen.

    Thanks

  • Stefan

    #2
    Re: splitter problems

    hi john
    the splitter and it's functions really depends on the order where
    the control are placed on the form.
    i would do the following
    1. place the treeview - Dock = left
    2. place the splitter - Dock = left
    3. place rhsPanel - Dock = fill

    "John" <john@no_spam > wrote in message
    news:uadjOqpdDH A.2672@tk2msftn gp13.phx.gbl...[color=blue]
    > Hi,
    > I have a group of controls in a panel on the right-hand side of a
    > splitter and a treeview on the left-hand side.
    > The only configuration that I can find to make the right-hand side
    > resize correctly is:
    >
    > lhsTreeview - Dock = Fill, Anchor = Top,Left
    > splitter - Dock = Right
    > rhsPanel - Dock = Right, Anchor = Top,Left
    >
    > The problem is that resizing the form repositions the splitter, making
    > the the left-hand side treeview grow, I would rather that the splitter
    > not reposition, resulting in the right-hand side growing.
    >
    > What settings should be changed to make this happen.
    >
    > Thanks
    >[/color]


    Comment

    • Frans Bouma

      #3
      Re: splitter problems

      John <john@no_spam > wrote in news:uadjOqpdDH A.2672@tk2msftn gp13.phx.gbl:
      [color=blue]
      > Hi,
      > I have a group of controls in a panel on the right-hand side of a
      > splitter and a treeview on the left-hand side.
      > The only configuration that I can find to make the right-hand side
      > resize correctly is:
      >
      > lhsTreeview - Dock = Fill, Anchor = Top,Left
      > splitter - Dock = Right
      > rhsPanel - Dock = Right, Anchor = Top,Left
      >
      > The problem is that resizing the form repositions the splitter, making
      > the the left-hand side treeview grow, I would rather that the splitter
      > not reposition, resulting in the right-hand side growing.
      >
      > What settings should be changed to make this happen.[/color]

      the control that is set to 'fill' will resize when you have a
      splitter in place and you resize the window. If you want to have another
      control to resize, you have to set that other control to Fill instead of
      the treeview, in your case the rhsPanel.

      As Stefan said, it depends on the order in the form where the
      splitter docks against. You can change that by bringing a control to the
      front / sending it to the back in the gui designer.

      FB

      --
      Get LLBLGen Pro, the new O/R mapper for .NET: http://www.llblgen.com

      Comment

      • John

        #4
        Re: splitter problems

        Stefan wrote:
        [color=blue]
        > hi john
        > the splitter and it's functions really depends on the order where
        > the control are placed on the form.
        > i would do the following
        > 1. place the treeview - Dock = left
        > 2. place the splitter - Dock = left
        > 3. place rhsPanel - Dock = fill
        >[/color]

        Thanks, but that configuration will not reposition the controls on the
        rhs, ie. moving the splitter right will move the treeview over the rhs
        controls.

        Comment

        • Pete

          #5
          Re: splitter problems

          Hi,

          John wrote:[color=blue]
          > Thanks, but that configuration will not reposition the controls on the
          > rhs, ie. moving the splitter right will move the treeview over the rhs
          > controls.[/color]

          Have you set the Anchor styles for the controls on the right panel? The
          panel itself is DockStyle.Fill so it will resize okay.

          -- Pete


          Comment

          • John

            #6
            Re: splitter problems

            Frans Bouma wrote:
            [color=blue]
            > As Stefan said, it depends on the order in the form where the
            > splitter docks against. You can change that by bringing a control to the
            > front / sending it to the back in the gui designer.
            >[/color]

            This is correct, the problem is that the order is determined by the
            order that you place the controls on the form in the Design view. The
            left-hand side control *must* be placed on the form before right-hand
            side control. If you placed the right-hand control on first, you must
            remove all your controls and start from scratch. I could not find anyway
            to get it to work, after placing the right-hand side control first,
            either by send to back / front or manually moving the control creation
            code in InitializeCompo nent().

            MS Moderators, please take note of this and create a KB article, and,
            please, fix it for the next release.

            Thanks

            Comment

            • John

              #7
              Re: splitter problems

              John wrote:[color=blue]
              >
              > MS Moderators, please take note of this and create a KB article, and,
              > please, fix it for the next release.
              >[/color]

              The following code in the splitter1.Locat ionChanged event will show that
              the right-hand side panel does not change size if it is placed on the
              control after the left-hand side panel in Desgin view with following
              configuration:

              panel2 Dock=left
              panel1 Dock=fill
              splitter1 Dock=left

              private void splitter1_Locat ionChanged(obje ct sender, EventArgs e)
              {
              Trace.WriteLine ("Panel1 size: " + panel1.Size.ToS tring());
              Trace.WriteLine ("Panel2 size: " + panel2.Size.ToS tring());
              }

              Comment

              • John

                #8
                Re: splitter problems

                John wrote:
                [color=blue]
                >
                > The following code in the splitter1.Locat ionChanged event will show that
                > the right-hand side panel does not change size if it is placed on the
                > control after the left-hand side panel in Desgin view[/color]

                Doh!
                "after" should be "before"

                Anyways, from the previous posts you get my drift :)

                Comment

                Working...