tags:

views:

33

answers:

2

I have a dynamically created tabpage for windows forms. the tabpage is split into two horizontal panels. The top panel should be able to hold up to 4 textboxes like this

TextBox1

TextBox2

TextBox3

TextBox4

There WILL be atleast one TextBox. Maximum is 4. How do I create a TabPage with two panels where the top panel only takes up the real estate as needed(i.e only use up the real estate for one textbox or 2 textboxes, or 3 textboxes or the maximum 4 textboxes) and the rest of the tabpage is available for Panel2.

A: 

Adjust the TabPage.height for the count of TextBox instances. Adjust the lower TabPage.height to fill in the remaining space.

dlamblin
A: 

Have you looked at FlowLayoutPanel? You can make any control (which a textbox is if i remember correctly) in the panel to break, that is, make the next control appear on a "new line". This property appears in the Property Window when selecting a control inside the panel, I just don't remember the name.

CS