Search code examples
vb.netwinformssplitcontainer

Change the height of the panel of the split container at runtime


I have a splitcontainer and I would change the height of the panel1 at runtime. I use this code

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        SplitContainer1.Panel1.Height = 2
    End Sub

It's possible ? Does anybody have any suggestion?

Thanks a lot in advance.


Solution

  • I think you're looking for the property SplitContainer.SplitterDistance. From the documentation:

    Gets or sets the location of the splitter, in pixels, from the left or top edge of the SplitContainer.