Form

Inheritance Hierarchy

          IComponent

          IControl

          IFormControl

          IFormClass

          Form

Description

A form is the main component, which contains all the other form designer components. The Form class is used to create standard windows, tool windows, unframed and scrollable windows. The Form class is also used to create modal windows, for example, a dialog box. To determine form parameters, use properties and methods implemented in IFormControl. Active form parameters from the Fore language can be obtained using the Active property, or using the Self reserved identifier. Self returns the parameters of the form, within which it has been called.

MDI

The special type of applications is a multidialog interface application (MDI). An MDI application is the main MDI form. The main form area shows child MDI forms as separate windows.

To create a main MDI form, set the WindowStyle property to MDIFrame. Child MDI forms are created by setting in the WindowStyle property to MDIChild.

Only the following components can be used on the main MDI form: BannerBar, ControlBar, MainMenu, ReportFormulaBar, Ribbon, Toolbar. Child MDI forms can contain any components.

When an MDI application is used, all child MDI forms are displayed in a special area within the main MDI form. The upper part of this area shows tabs for all opened child MDI forms. The tabs have a context menu that is used to manage opened child MDI forms. This menu contains three items:

To activate the MDI form, either click the corresponding tab or select the in the list that opens on clicking the button. This button is located in the right part of the tab area. To close the child MDI form, click the appropriate tab using the middle mouse button (mouse wheel). To close the active child MDI form:

In the Fore language the child MDI windows are managed using corresponding properties and methods implemented in the IFormControl interface. When child MDI windows are created in the CreateForm method, the main MDI form must be passed as a parent window.

NOTE. A form opened modally for its child MDI form will exist independently of this form. When a child MDI form is closed, the forms opened for it modally will be available. All modal forms will be closed when the main (MDIFrame) MDI form is closed.

Example

Form Properties

  Property name Brief description

Active

The Active property returns parameters of the form, which is active at the moment.

MakeShortcut

The MakeShortcut property returns the value corresponding to a hotkey combination, which must be assigned to some action.

Form Methods

  Method name Brief description

CreateForm

The CreateForm method creates a new form.

Form Events

  Event name Brief description

OnActivate

The OnActivate event occurs when a form or one of its child components gets focus.

OnBeginDrag

The OnBeginDrag event occurs for a component when the user starts to drag an object from the component.

OnClick

The OnClick event occurs if the user clicks in the form area.

OnClose

The OnClose event occurs right before a form is closed.

OnCloseQuery

The OnCloseQuery event occurs when a form gets command to be closed.

OnCommand

The OnCommand event occurs when a command to this form is sent from another form.

OnCreate

The OnCreate event occurs at the moment a form is created.

OnDblClick

The OnDbClick event occurs if the user double-clicks in the form area.

OnDeactivate

The OnDeactivate event occurs when a form or one of its child components loses focus.

OnDragDrop

The OnDragDrop event occurs for the component if the user drops a dragged object over it.

OnDragEnter

The OnDragEnter event occurs when a dragged object crosses the borders of this component.

OnDragLeave

The OnDragLeave event occurs when a dragged object leaves the borders of this component.

OnDragOver

The OnDragOver event occurs for the component when the user drags an object over it.

OnEnter

The OnEnter event occurs when the component receives focus.

OnExit

The OnExit event occurs when the component loses focus.

OnHelp

The OnHelp event occurs if the user clicks the component in the active Help displaying mode, or presses the F1 key for the active component.

OnHide

The OnHide event occurs right before a form becomes hidden.

OnMDIActivate

The OnMDIActivate event occurs when an active child MDI form is changed.

OnKeyDown

The OnKeyDown event occurs if the component is focused and a keyboard key is pressed.

OnKeyPress

The OnKeyPress event occurs if the component is focused when the user presses a character key.

OnKeyPreview

The OnKeyPreview event occurs prior to each event related to key pressing.

OnKeyUp

The OnKeyUp event occurs if the component is focused and the user releases any button previously pressed.

OnMouseDown

The OnMouseDown event occurs if the cursor is in component's area and a mouse button is pressed.

OnMouseEnter

The OnMouseEnter event occurs when the mouse cursor enters the component's area.

OnMouseHover

The OnMouseHover event occurs when the mouse cursor is held in the component's area.

OnMouseLeave

The OnMouseLeave event occurs when the mouse cursor leaves the component's area.

OnMouseMove

The OnMouseMove event occurs when the mouse cursor is moved over the component.

OnMouseUp

The OnMouseUp event occurs if the user releases mouse button when the cursor is in the component area.

OnMouseWheel

The OnMouseWheel event occurs if the component is focused when the user rotates mouse wheel.

OnResize

The OnResize event occurs after a form is resized.

OnShow

The OnShow event occurs just before a form is displayed.

See also:

Development Environment Components