blah blah blah is here! blah blah » Close

up0down
link

DESKTOP APPLICATION.

Hi, below is the problem briefed:
In my home form I have a splitcontainer and few buttons. When the buttons are clicked respective forms are opened in the splitcontainer. The splitcontainer is anchored- top, left, right, bottom so that when the home form is resized the splitcontainer resizes itself automatically. The controls within the other forms are also anchored properly to resize themselves accordingly. But the problem is when i open a form in the splitcontainer, even if I resize the home form, the controls in the form within the splitcontainer aren't resizing. The reason is when the home form is resized the splitcontainer is resizing itself accordingly but the form inside the splitcontainer isn't (as forms don't have anchor or dock properties so I couldn't set them). As a result though the controls in the sub form are anchored to resize themselves yet they aren't. How to solve it.

In short I want the form in the splitcontainer and all the controls in it to resize automatically when the home form/splitcontainer is resized. Regards.

last answered one year ago

2 answers

up0down
link

try making a table layout and make the table to dock as fill in the split container. then set the columns and rows in the table as % like 20%,80%. After that dock as fill every control in each cell.

up0down
link

Never mind! I missed a small property. When you call the subform in the splitcontainer of the main form just set the property Dock to Fill.

dim objFrmSubForm as New frmSubForm()
objFrmSubForm.Dock=DockStyle.Fill
objFrmSubForm.Show()
objFrmSubForm=Nothing


Regards.

Feedback