Question

We have an application with a main form and a second non-modal form which can be used side by side. Our main form shows a list of configurations, while the second non-modal form shows a configuration in more detail.

When we show a modal form (requested from the second non-modal form), the main form pops up in front of the second form until we close that modal form.

How can I avoid this behaviour? I already tried creating that last modal form in different ways ('Applicaton.CreateForm', 'TForm.Create', setting the parent), but still get the main form to pop up.

Any ideas?

Thanks in advance!

Was it helpful?

Solution

Set Application.ModalPopupMode to pmAuto

This is what the documentation says:

TForm.PopupParent

Sets an order for stacked forms that users cannot change. If the PopupMode property is set to pmExplicit and PopupParent is nil, then the Application.MainForm is implicitly used as the PopupParent. If no Application.MainForm is assigned, then Application.Handle is used as the PopupParent. If the PopupMode property is set to pmAuto, Screen.ActiveForm is used as the PopupParent property.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top