Show: Delphi C++
Display Preferences

Vcl.Forms.TForm.Position

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Position: TPosition read FPosition write SetPosition stored IsForm default 2;

C++

__property Position = {default=2};

Properties

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

Description

Represents the size and placement of the form.

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

Represents the size and placement of the form.

Use Position to get or set the size and placement of the form. Position can have one of the following TPosition values:



Value Meaning

poDesigned

The form appears positioned on the screen and with the same height and width as it had at design time.

poDefault

The form appears in a position on the screen and with a height and width determined by the operating system. Each time you run the application, the form moves slightly down and to the right. The right side of the form is always near the rightmost side of the screen, and the bottom of the form is always near the bottom of the screen, regardless of the screen's resolution.

The operating system only supports this for overlapped windows. For a pop-up or child window (that has a BorderStyle of bsDialog or bsNone, for example), the window is positioned in the upper-left corner of the screen.

poDefaultPosOnly

The form displays with the size you created it at design time, but the operating system chooses its position on the screen. Each time you run the application, the form moves slightly down and to the right. When the form can no longer move down and to the right and keep the same size while remaining entirely visible on the screen, the form displays at the upper-left corner of the screen.

The operating system only supports this for overlapped windows. For a pop-up or child window (that has a BorderStyle of bsDialog or bsNone, for example), the window is positioned in the upper-left corner of the screen.

poDefaultSizeOnly

The form appears in the position you left it at design time, but the operating system chooses its size. The right side of the form is always near the rightmost side of the screen, and the bottom of the form is always near the bottom of the screen, regardless of the screen's resolution.

poScreenCenter

The form remains the size you left it at design time, but is positioned in the center of the screen. In multi-monitor applications, the form may be moved from this center position so that it falls entirely on one monitor, as specified by the DefaultMonitor property.

poDesktopCenter

The form remains the size you left it at design time, but is positioned in the center of the screen. No adjustments are made for multi-monitor applications.

poMainFormCenter

The form remains the size you left it at design time, but is positioned in the center of the application's main form. No adjustments are made for multi-monitor applications. This position should only be used with secondary forms. If set for a main form, it acts like poScreenCenter.

poOwnerFormCenter

The form remains the size you left it at design time, but is positioned in the center of the form specified by the Owner property. If the Owner property does not specify a form, this position acts like poMainFormCenter.



Note that if Position is set to poDefault, poDefaultPosOnly or poDefaultSizeOnly, and BorderStyle is set to bsDialog or bsNone, the form will be positioned at (0,0).

See Also

Personal tools
Translations