Previous Topic

Next Topic

Self Object

Navigator > Setup > Form Designer > Code tab > MenuPopup Objects (Alt+J) > Self

The Self object reports details of the form being designed.

Select a field form the list, and it will be inserted into the Code window. For example, if you click the Name field, Self.Name will be inserted in the code window. Several fields represent the Form Properties.

Fields available are:

Field

Description

ActiveProperty

Returns the name of the Property on the form that is active.

AlignWithMargins

Form AlignWithMargins property value.

BorderStyle

Form BorderStyle property value.

BorderWidth

Form BorderWidth property value.

Caption

Form Caption property value.

ClassName

Returns the ClassName of the Form object.

ClientHeight

Form ClientHeight property value.

Color

Form Color property value.

Constraints

Enter a constraint, to return the constraint property value. Available values are:

  • Self.Constaints.MaxHeight
  • Self.Constaints.MaxWidth
  • Self.Constaints.MinHeight
  • Self.Constaints.MinWidth

Enabled

Form Enabled property value.

Font

Select a Font Property from the list. The Font can affect components on the form with ParentFont set to True. See Font Properties.

Height

Form Height property value.

IsCustomForm

Returns True for Custom forms. For Form Designer Forms, this always returns True.

IsFloatingWindow

Returns True for forms in a floating window state, returns False otherwise.

Margins

Enter a margin, to return the margin property value. Available values are:

  • Self.Margins.Bottom
  • Self.Margins.Left
  • Self.Margins.Right
  • Self.Margins.Top

ModalResult

Returns True when the form is being displayed modally, returns False otherwise.

Name

The Form Name. This can be set in the code.

Padding

Enter a padding value, to return the padding property value. Available values are:

  • Self.Padding.Bottom
  • Self.Padding.Left
  • Self.Padding.Right
  • Self.Padding.Top

SaveSizeName

Form SaveSizeName property value.

TabCaption

TabCaption can be set explicitly in code e.g. where a shorter caption is wanted for Tabbed maximised forms. Synchronisedwith FD Form Caption on change of Caption if both were the same prior to the change.

Visible

Form Visible property value.

Width

Form Width property value.

WindowState

Form WindowState property value.

Methods available to the Self Object are:

Method

Description

BringToFront

Bring the form in front of other windows.

Close

Closes the form.

ForceWindowToForeground

Forces the form to the front with focus.

GetPropertyValue

Returns the value of a property of the component.

Hide

Hide the form.

PropertyType

Returns the type of a property for the component.

ScaleToForm

Returns a number of pixels at the scaled size, based on the number provided.

SendToBack

Moves the form behind other windows.

SetFocus

Set the focus to the component.

SetPropertyValue

Sets the value of a property of the component.

Show

Show the form.

ShowErrorHint

Show an error hint for the component. Specify the hint.

ShowFieldErrorHint

Show an error hint for a component on the form.

ShowModal

Show the form in a modal state.

ShowStatusHint

Show a status hint for the component. Specify the hint.

See Also

Form Designer Objects

Book Contents

Book Index