开发者

Child Form positioning like StatusBar

开发者 https://www.devze.com 2022-12-27 17:33 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消