I have a MDIForm with a MenuBar and a StatusBar. When I create a childform and position it with "Align = alBottom" the form goes out off the screen area and main开发者_如何转开发form scrollbars are activated. How to position the childform just over the StatusBar?
Align and Anchors do not really work as expected for a Control that has no Parent responsible for displaying it.
That is what happens to your ChildForm: its Parent is nil.
Besides, for ChildForms it's more usual to follow the normal Windows management (maximize, minimize, cascade, tile...)
If you want to position it some particular place, your best bet is to calculate where to place it using the MainForm's ClientHeight and ClientWidth.
Try docking it.
//... after creating DlgChildForm
DlgChildForm.ManualDock(MainForm, nil, alBottom);
DlgChildForm.Visible := True;
MDI child forms are not designed to be aligned in a certain location, or docked. They're designed to be contained within the MDI parent, and either free-floating or maximized over the parent's surface.
If you need forms that can be positioned using alignment or docking, you shouldn't be using MDI.
精彩评论