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
The Active property returns parameters of the form, which is active at the moment.
The MakeShortcut property returns the value corresponding to a hotkey combination, which must be assigned to some action.

Form Methods

  Method name Brief description
The CreateForm method creates a new form.

Form Events

  Event name Brief description
The OnActivate event occurs when a form or one of its child components gets focus.
The OnBeginDrag event occurs for a component when the user starts to drag an object from the component.
The OnClick event occurs if the user clicks and releases the mouse button when the mouse cursor is over the component.
The OnClose event occurs right before a form is closed.
The OnCloseQuery event occurs when a form gets command to be closed.
The OnCommand event occurs when a command to this form is sent from another form.
The OnCreate event occurs at the moment a form is created.
The OnDbClick event occurs if the user double-clicks in the form area.
The OnDeactivate event occurs when a form or one of its child components loses focus.
The OnDragDrop event occurs for the component if the user drops a dragged object over it.
The OnDragEnter event occurs when a dragged object crosses the borders of this component.
The OnDragLeave event occurs when a dragged object leaves the borders of this component.
The OnDragOver event occurs for the component when the user drags an object over it.
The OnEnter event occurs when the component receives focus.
The OnExit event occurs when the component loses focus.
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.
The OnHide event occurs right before a form becomes hidden.
The OnMDIActivate event occurs when an active child MDI form is changed.
The OnKeyDown event occurs if the component is focused and the keyboard key is pressed.
The OnKeyPress event occurs if the component is focused when the user presses a character key.
The OnKeyPreview event occurs prior to each event related to key pressing.
The OnKeyUp event occurs if the component is focused and the user releases any button previously pressed.
The OnMouseDown event occurs if the cursor is in component's area and a mouse button is pressed.
The OnMouseEnter event occurs when the mouse cursor enters the component's area.
The OnMouseHover event occurs when the mouse cursor is held in the component's area.
The OnMouseLeave event occurs when the mouse cursor leaves the component's area.
The OnMouseMove event occurs when the mouse cursor is moved over the component.
The OnMouseUp event occurs if the user releases mouse button when the cursor is in the component area.
The OnMouseWheel event occurs if the component is focused when the user rotates mouse wheel.
The OnResize event occurs after a form is resized.
The OnShow event occurs just before a form is displayed.

See also:

Fore Components