Vcl.Forms.TForm.PopupMode

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property PopupMode;

C++

__property PopupMode = {default=0};

Properties

Type Visibility Source Unit Parent
property published
Vcl.Forms.pas
Vcl.Forms.hpp
Vcl.Forms TForm

Description

Controls how the top-level form behaves with respect to Window's WS_POPUP style.

Vcl.Forms.TForm.PopupMode inherits from Vcl.Forms.TCustomForm.PopupMode. All content below this line refers to Vcl.Forms.TCustomForm.PopupMode.

Controls how the top-level form behaves with respect to Window's WS_POPUP style.

The PopupMode property controls how the top-level form behaves with respect to Window's WS_POPUP style. A window that has the WS_POPUP style is always above its "owner" in Z-order. You can use the PopupMode property in conjunction with the PopupParent property to avoid the appearance of a hung application caused by a modal dialog showing up behind another form on the screen.

Note: Using the PopupMode property is similar to specifying fsStayOnTop for the FormStyle property, but allows better control over the layering.

The PopupMode property is automatically set to pmAuto when the ShowModal method is called. However, this causes the window handle to be recreated, which is not usually desirable. To avoid the re-creation of window handles, you can explicitly set the PopupMode property to pmAuto prior to calling the ShowModal method (such as at design time).

Set the PopupMode property to pmExplicit for non-modal design windows such as tool palettes and other floating tool windows. This causes the windows to always remain on top of the main form. In the case of a snapped together design (in which the window is docked to the main form), the design window remains on top of the designer.

Note: For undocked windows, the design window remains above the main form, allowing other top-level forms to obscure the design window.

Set the PopupMode property to pmNone if you want the pop-up window to have the pre-Delphi 8 behavior (except for the ShowModal item mentioned above).

You can force the Z-Ordering of your forms and create a "stacked" appearance that the user cannot change by setting the PopupParent property to an explicit TCustomForm. If the PopupMode property is 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.