I am having questions about a program that I’m developing. Sorry if my post is not clearly legible, as a beginner programming perfectionist I try to explain everything clearly as possible.
I have a Windows Form called frmMain.vb with two separate panels, one is called sidebarPanel and the other one is called mainPanel:

At runtime, this is how the form looks like:
I reduced the screen to let it fit in this topic, the actual size is 900, 600 through this code at frmMain_Load:
Me.Size = New Size(900, 600)

Now I have created the following piece of code:
With sidebarPanel
.Top = 0
.Left = 0
.Width = 200
.Height = 300
End With
With mainPanel
.Top = 0
.Left = 200
.Width = 200
.Height = 300
End With
In case you’re wondering how the sidebar is blue, that piece comes from a dll, that piece of the code I’ve left out to keep this question easy. If you look closely at the source code you can see that the sidebar has a width of 200 and the mainpanel start 200 width from the left.
With that out of the way. I want to know the answer, I’ve searched Stackoverflow, Google and some VB.NET forums about these questions but I seem to be a loner.
How can I make the sidebar a full 100% height to the form so if I resize, the sidebar will change height too. That same question goes for the mainpanel.
Thank you for reading and thank you for the hospitality and the answer.
You can manually do so in the form’s
Resizeevent, by setting theHeightproperty of the panels toMe.ClientSize.Height, however, it’s easier to just do it all at design time.To do so, in the form designer, first position and resize the panels so that they are where you want them to be for the current form size, then set the
Dockproperty appropriately on both. You want the side panel’sDockproperty to be set to Top, Left, and Bottom. You probably want the main panel’sDockproperty set to Top, Bottom, Left, and Right (all four sides). When the dock property is set properly, the controls will automatically resize themselves as the form is resized.After you have set the
Dockproperty, you can test it by resizing the form right in the designer.