Positioning a child shape like StatusBar

I have MDIForm with MenuBar and StatusBar. When I create a child form and position it with "Align = alBottom", the form extends out of the screen area and the scrollbars of the main form are activated. How do I place the child shape just above the StatusBar?

+2


a source to share


3 answers


Alignment and anchors do not work as expected for a control that does not have a parent to display it.
This is what happens to your ChildForm: its parent is zero.
Also, it is more common for ChildForms to be the normal Windows control (maximize, minimize, cascade, tiling ...)
If you want to place it in a specific location, your best bet is to figure out where to place it using the MainForm ClientHeight and ClientWidth.



+1


a source


Try docking.



//... after creating DlgChildForm

DlgChildForm.ManualDock(MainForm, nil, alBottom);
DlgChildForm.Visible := True;

      

0


a source


Child MDI Child Forms are not designed to align in a specific location or docked. They are intended to be placed inside an MDI parent and either float freely or maximized over the parent surface.

If you want shapes that can be positioned by alignment or docking, you shouldn't use MDI.

0


a source







All Articles