Mdiform resizing occurs form docking error

36 Views Asked by At

I'm using SplitContainer (It's contain two panels) control under my MdifForm.I'm using following code to showing my exist forms under SplitContainer panel2

   With My_Form
        .MdiParent = Me
        SplitContainer.Panel2.Controls.Add(My_Form)
        .My_Form_Activated(Me, e)
        .WindowState = FormWindowState.Maximized
        .Dock = DockStyle.Fill
        .Show()
    End With

Docking fill command work properly at first displaying of the My_Form. But after mdiform resizing, my_form size doesn't change. How can i fix this problem thanks.

1

There are 1 best solutions below

0
Sean On

do not use FormWindowState.Maximised. instead use FormWindowState.Normal and then rely on DockStyle.Fill.