I have a problem with WinForms (VB.NET).
The main window is the MDI container. The user opens a new child window:

and then maximizes it, so the window fills the client area correctly. My controls are properly tied (using the Anchor IDE property) to the sides of the window, so that enlarging the window always fills the client area well:

In this state (client windows are enlarged), the user opens another or new child window, but the new window controls are not stretched, that is, they do not "understand" that they must be stretched!

This is especially annoying because if the user tries to restore the window, then the controls are stretched, so they disappear (see no more list)!

This is mistake? How can i solve this?
edit: according to Hans Passant's comment, I created a new simple project and it worked as it should. Therefore, I researched what distinguishes my real project and sample. The difference is that in my project I dynamically create forms.
I am dynamically creating many toolbar buttons. When the user clicks the button, this is the code that is executed:
Private Sub buttonClicked(ByVal sender As System.Object, ByVal e As System.EventArgs) Cursor.Current = Cursors.WaitCursor Dim b As Button = CType(sender, Button) Dim assem As Assembly = Assembly.GetExecutingAssembly() Dim formType As Type = assem.GetType(CStr(b.Tag)) Dim exFormAsObj As Object = Nothing Try exFormAsObj = Activator.CreateInstance(formType) Catch ex As Exception Cursor.Current = Cursors.Default MessageBox.Show("clicca meglio:" + ex.ToString) Exit Sub End Try Dim f As Form = CType(exFormAsObj, Form) f.MdiParent = Me f.Show() Cursor.Current = Cursors.Default End Sub
That is, the form name is in the button tag. I create a new instance of the form, with Activator.CreateInstance(formType) , then I will show it: f.Show() .
I am sure the problem is creating this dynamic child form, but I cannot get there.
edit2: Found! In my form, the general loading event that I was doing
myform.SuspendLayout() ' various instructions myform.ResumeLayout(False)
instead of False, I would have to write true: myform.ResumeLayout(True)
So simple, sorry.