Form

Qualified name: delphifmx.Form

class Form

Bases: CustomForm

TForm represents a standard FireMonkey application window (form). When you create forms in the Form designer at design time, they are implemented as descendants of TForm. Forms can represent the application’s main window, or dialog boxes or various preferences-related windows. A form can contain any other FireMonkey objects, such as TButton, TCheckBox, TComboBox objects, and so on.

Methods

LoadProps

Load properties from a .pydfm file

Attributes

Action

Specifies the action associated with the control.

ActionClient

Specifies whether the component object has an associated action.

Active

Specifies whether the form has focus.

ActiveControl

Specifies the active control on the form.

BiDiMode

Indicates the layout of this form when running under Middle Eastern versions of the operating system.

Border

Embarcadero Technologies does not currently have any additional information.

BorderIcons

Specifies which icons appear on the title bar of the form.

BorderStyle

Specifies the appearance and behavior of the form border.

Bounds

Bounds of form - position and size.

BoundsF

Embarcadero Technologies does not currently have any additional information.

Canvas

Provides access to the drawing area of the form.

Caption

Specifies a text string that identifies the form to the user.

Captured

Specifies the control that has captured the mouse.

Children

Stores an array of children attached to this parent component.

ChildrenCount

Read-only property that specifies the number of children in the children list.

ClassName

Returns the TObject.ClassName

ClientHeight

Specifies the height (in pixels) of the form's client area.

ClientWidth

Specifies the width (in pixels) of the form's client area.

ComObject

Specifies the interface reference implemented by the component.

ComponentCount

Returns the owned component count

ComponentIndex

Indicates the position of the component in its owner's Components property array.

ComponentState

Describes the current state of the component, indicating when a component needs to avoid certain actions.

ComponentStyle

Governs the behavior of the component.

Components

Returns an iterator over the owned components

Constraints

Embarcadero Technologies does not currently have any additional information.

Cursor

Specifies the mouse cursor that will be used on this form.

Data

Stores a Tvalue, which is a data structure that can store different kinds of data types.

DesignInfo

Contains information used by the Form designer.

Designer

Specifies the designer interface for the form.

Fill

Specifies the way the background on this form is filled.

Focused

Specifies the control that has the focus set on it.

FormFactor

width, height, orientations, and devices.

FormFamily

Is a string property that specifies the form family this form is part of.

FormState

Indicates transitional state information about the form.

FormStyle

Determines the form style.

FullScreen

Indicates whether the form is in fullscreen mode.

Handle

Specifies the handle of this form.

Height

Specifies the vertical size of the form (in pixels).

Hovered

Identifies the control over which the mouse pointer is hovering.

Index

Specifies the index of the child object in the children array attached to this object.

Left

Specifies the X coordinate of the upper-left corner of the form, relative to the screen.

ModalResult

Represents the return value of a form that is used as a modal dialog box.

Name

Specifies the name of the component as referenced in code.

Observers

Indicates the TObservers object added to the TComponent.

OnConstrainedResize

Callable[[Object, float, float, float, float], None]:

OnGesture

Callable[[Object, GestureEventInfo, bool], None]:

OnPaint

Callable[[Object, Canvas, RectF], None]:

OriginalContainerSize

Embarcadero Technologies does not currently have any additional information.

Owner

Returns the Component Owner

Padding

Specifies the padding of the form.

Parent

Returns/Sets the Control Visibility

ParentForm

Specifies the parent form of this form.

Position

Represents the size and placement of the form.

Quality

Embarcadero Technologies does not currently have any additional information.

Root

Specifies the root parent of this object.

SaveState

Specifies the save state of the FireMonkey form.

ShowFullScreenIcon

Indicates whether the Mac fullscreen icon is visible.

ShowHint

Determines whether help hints are enabled or disabled for first level child controls in the form. For more information about the rules for enabling hints for a control, see Using Hints to Show Contextual Help in a FireMonkey Application. TCommonCustomForm.ShowHint is a Boolean property set as True by default. When you place a child control in the form, and set the TControl.Hint property, the hint is displayed because the TControl.ParentShowHint is True by default. If the TCommonCustomForm.ShowHint property of the form is set to False, the hint is not displayed in the child control. To show the hint for a control, even when the TCommonCustomForm.ShowHint property of the form is set to False, set TControl.ShowHint for the control to True.

Stored

Specifies whether this object is stored in the .XFM file.

StyleBook

Specifies the style book for this form.

StyleLookup

Specifies the name of the style to look up and apply to this form.

StyleName

Specifies the style name for this FMX component.

SystemStatusBar

System status bar settings on mobile platforms.

Tag

Stores a NativeInt integral value as a part of a component.

TagFloat

Custom property that stores any floating-point value.

TagObject

Custom property that stores any object value.

TagString

Custom property that stores any string value.

Top

Specifies the Y coordinate of the upper-left corner of the form, relative to the screen.

Touch

Embarcadero Technologies does not currently have any additional information.

Transparency

Indicates whether the form is transparent or not.

VCLComObject

Represents information used internally by components that support COM.

Visible

Indicates whether the form is visible.

Width

Specifies the horizontal size of the form (in pixels).

WindowState

Represents how the form appears on the screen.

WindowStyle

Embarcadero Technologies does not currently have any additional information.

Action

Specifies the action associated with the control. Action allows an application to centralize the response to user commands. When a control is associated with an action, the action determines the appropriate properties and events of the control (such as whether the control is enabled or how it responds to an OnClick event). If an object of the descendant from the TFmxObject class does not support actions, and when this object tries to assign a value to the Action property, the setter method for Action calls GetActionLinkClass that should return nil. In this case, attempting to set a value to the Action property raises the following exception:

StrEActionNoSuported = ‘Class %s does not support the action’

Type:

BasicAction

ActiveControl

Specifies the active control on the form. Use ActiveControl to get or set the active control (having the focus) on the form. Only one control can have the focus at a given time, in an application. If the form does not have the focus, ActiveControl is the control, on the form, that receives the focus when the form itself receives the focus.

Type:

Control

BiDiMode

Indicates the layout of this form when running under Middle Eastern versions of the operating system. Use BiDiMode to specify the bi-directional mode for the application. The bi-directional mode controls the direction in which text appears (left-to-right or right-to-left), the placement of vertical scroll bars, and the default alignment of text when the application runs in Middle Eastern locales.

Type:

BiDiMode

Border

Embarcadero Technologies does not currently have any additional information.

Type:

FormBorder

BorderIcons

Specifies which icons appear on the title bar of the form. Use BorderIcons to get or set the icons that appear on the title bar of the form. BorderIcons can include any of the following TBorderIcons values:

Value

Meaning

biSystemMenu

The form has a Control menu (also known as a System menu).

biMinimize

The form has a Minimize button.

biMaximize

The form has a Maximize button.

biHelp

Has no effect in FireMonkey.

Type:

BorderIcons

BorderStyle

Specifies the appearance and behavior of the form border. Use BorderStyle to get or set the appearance and behavior of the form border. BorderStyle can be any of the following TFmxFormBorderStyle values:

Value

Meaning

Single

Not resizable; minimize/maximize menu

None

Not resizable; no visible border line

Sizeable

Standard resizable border

ToolWindow

Similar to Single, but with a smaller caption

SizeToolWin

Similar to Sizeable, but with a smaller caption

Notes:

In iOS applications, None makes your form run in fullscreen mode. With any other value, your iOS app shows the iOS status bar. In Android applications, the BorderStyle property does not control fullscreen display. Instead, you should set the theme property on the Project > Options > Version Info page of your Android project: Setting the theme = TitleBar means that your Android app includes a title or status bar. Setting the theme = NoTitleBar means that your Android app runs in fullscreen mode, without a title or status bar.

Type:

FmxFormBorderStyle

Caption

Specifies a text string that identifies the form to the user. Use Caption to specify the text string that labels the form, identifying it to the user.

Type:

str

ClientHeight

Specifies the height (in pixels) of the form’s client area. Use ClientHeight to determine the height (in pixels) of the form’s client area. The client area is the usable area inside the form’s border, excluding the title bar, scroll bars, and so on. Set ClientHeight to change the height of the form’s window based on the desired client area. To change the height of the form’s window based on the total size of the window (including the border, menu, status bar and so on), use the Height property instead.

Type:

int

ClientWidth

Specifies the width (in pixels) of the form’s client area. Use ClientWidth to determine the width (in pixels) of the form’s client area. The client area is the usable area inside the form’s border. Set ClientWidth to change the width of the form’s window based on the desired client area. To change the width of the form’s window based on the total size of the window (including the border, status bar, and so on), use the Width property instead.

Type:

int

Constraints

Embarcadero Technologies does not currently have any additional information.

Type:

SizeConstraints

Cursor

Specifies the mouse cursor that will be used on this form.

Type:

int

Fill

Specifies the way the background on this form is filled. Use Fill to get or set the brush that defines the way the background of this form is painted (gradient, solid, and so on).

Tip: Using a brush for Fill overrides the functionality of the Transparency property.

Type:

Brush

FormFactor

width, height, orientations, and devices.

Type:

FormFactor

Type:

Specifies the form factor for this FireMonkey form, that is, the TFormFactor properties

FormFamily

Is a string property that specifies the form family this form is part of. The logic can choose a different form as the main form depending on size, if an app has several forms with the same .FormFamily value as the app’s main form.

Type:

str

FormStyle

Determines the form style. FormStyle is one of the Normal, Popup, or StayOnTop values defined in TFormStyle.

Type:

FormStyle

FullScreen

Indicates whether the form is in fullscreen mode. Use FullScreen to specify whether the form is in fullscreen mode.

Type:

bool

Height

Specifies the vertical size of the form (in pixels). Use the Height property to read or change the height of the form.

Type:

int

Left

Specifies the X coordinate of the upper-left corner of the form, relative to the screen. Use Left to locate the top of the form or reposition the form to a different X coordinate. The Left property, like the Top property, is the position of the form relative to its container (the screen), in pixels.

Type:

int

LoadProps()

Load properties from a .pydfm file

OnConstrainedResize

Callable[[Object, float, float, float, float], None]:

OnGesture

Callable[[Object, GestureEventInfo, bool], None]:

OnPaint

Callable[[Object, Canvas, RectF], None]:

Padding

Specifies the padding of the form. The Padding of a form specifies how close, in pixels, the child of the form can come to each of its edges (top, left, bottom, right). Padding adds space to the inner side of the form. The child of the form is repositioned and resized, if necessary, to fit the Padding.

Type:

Bounds

Parent

Returns/Sets the Control Visibility

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 TFormPosition values:

Value

Meaning

Designed

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

Default

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 None, for example), the window is positioned in the upper-left corner of the screen. On OS X, the default position for new windows is the upper-left corner of the screen.

DefaultPosOnly

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 in 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 None, for example), the window is positioned in the upper-left corner of the screen. On OS X, the default position for new windows is the upper-left corner of the screen.

DefaultSizeOnly

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.

ScreenCenter

The form remains the size you left it at design time, but is positioned in the center of the screen.

DesktopCenter

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.

MainFormCenter

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 ScreenCenter.

OwnerFormCenter

The form remains the size you left it at design time, but is positioned in the center of the owner form. If there is no owner form, this position acts like MainFormCenter.

Note that, if Position is set to Default, DefaultPosOnly, or DefaultSizeOnly, and BorderStyle is set to None, the form will be positioned at (0,0).

Type:

FormPosition

Quality

Embarcadero Technologies does not currently have any additional information.

Type:

CanvasQuality

ShowFullScreenIcon

Indicates whether the Mac fullscreen icon is visible. Use ShowFullScreenIcon to specify whether the Mac fullscreen icon or is visible.

Note: ShowFullScreenIcon has no visible effect in Windows.

Type:

bool

ShowHint

Determines whether help hints are enabled or disabled for first level child controls in the form. For more information about the rules for enabling hints for a control, see Using Hints to Show Contextual Help in a FireMonkey Application.

TCommonCustomForm.ShowHint is a Boolean property set as True by default. When you place a child control in the form, and set the TControl.Hint property, the hint is displayed because the TControl.ParentShowHint is True by default.

If the TCommonCustomForm.ShowHint property of the form is set to False, the hint is not displayed in the child control. To show the hint for a control, even when the TCommonCustomForm.ShowHint property of the form is set to False, set TControl.ShowHint for the control to True.

Type:

bool

StyleBook

Specifies the style book for this form. For more information on how to customize the looks of a FireMonkey application with styles, refer to the Customizing FireMonkey Applications with Styles help topic.

Type:

StyleBook

StyleLookup

Specifies the name of the style to look up and apply to this form. The FireMonkey Component Design help topic shows, among other useful things related to component designing, how to apply a style to a TPanel component.

Type:

str

SystemStatusBar

System status bar settings on mobile platforms.

Type:

FormSystemStatusBar

Top

Specifies the Y coordinate of the upper-left corner of the form, relative to the screen. Use Top to locate the top of the form or reposition the form to a different Y coordinate. The Top property, like the Left property, is the position of the form relative to its container (the screen), in pixels.

Type:

int

Touch

Embarcadero Technologies does not currently have any additional information.

Type:

TouchManager

Transparency

Indicates whether the form is transparent or not. Use Transparency to determine whether the form is displayed as a totally transparent one. However, note that in this situation, all the controls will not be transparent and will be displayed normally. Only the form’s background will be set to a transparent state. If you set Transparency to True, the form will not display its title bar, nor its border. This means that you need to apply programmatic methods (involving setting of the Top and Left properties) to move the form on the screen surface.

Type:

bool

Visible

Indicates whether the form is visible. Use Visible to determine whether the form is visible. If Visible is True, the form is visible unless it is completely obscured by other forms. If Visible is False, the form is not visible. The Show and ShowModal methods set Visible to True and bring the form to the front of all open windows.

Type:

bool

Width

Specifies the horizontal size of the form (in pixels). Use the Width property to read or change the width of the form.

Type:

int

WindowState

Represents how the form appears on the screen. Set WindowState to minimize, maximize, or restore the form window. Read WindowState to determine whether the form is minimized, maximized, or in a normal state. Possible values for the WindowState property are:

wsMaximized wsMinimized wsNormal

Type:

WindowState