Search code examples
vb.netmdiparent

Windows Form application set as MdiContainer, child forms change display on load


I have a basic Windows Form application, written in VB.

Main Form is set to IsMdiContainer = true.

I have a simple childForm setup to the correct size to fill the space. I create a global variable of it.

Public childForm as childFormClass = new childFormClass

I set childForm.MdiParent = Me (i.e. MainForm)

When I call childForm.Show() the various controls are not in there designed locations, and some even gone? (assume off the side). Things seem to move to the right.

I have been chasing this issue for a while and cannot find a solution. Any advice welcomed.

Cheers, Graeme

Child Form design

Running app showing moved and missing controls


Solution

  • Fixed. On the child form, I had to set AutoScalMode = Inherit

    It was still on the default of AutoScalMode = font