A container for other controls.

Syntax

[<oRef> =] new Container(<container> [,<name expC>])

<oRef>

A variable or property—typically of <container>—in which to store a reference to the newly created Container object.

<container>

The container—typically a Form object—to which you’re binding the Container object.

<name expC>

An optional name for the Container object. If not specified, the Container class will auto-generate a name for the object.

Properties

The following table lists the properties of interest in the Container class. (No particular methods are associated with this class.)

Property

Default

Description

allowDrop

false

Whether dragged objects can be dropped in the Container

anchor

0 – None

How the Container object is anchored in its container (0=None, 1=Bottom, 2=Top, 3=Left, 4=Right, 5=Center, 6=Container)

baseClassName

CONTAINER

Identifies the object as an instance of the Container class

className

(CONTAINER)

Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName

colorNormal

BtnFace

The background color

expandable

true

Reports only: whether the container expands to show all its components

transparent

false

Whether the container has the same background color or image as the its own container (usually the form)

 

Event

Parameters

Description

onDragEnter

<left expN>
<top expN>
<type expC>
<name expC>

When the mouse enters the Container's display area during a Drag&Drop operation

onDragLeave

 

When the mouse leaves the Container's display area without having dropped an object

onDragOver

<left expN>
<top expN>
<type expC>
<name expC>

While the mouse drags an object over the Container's display area during a Drag&Drop operation

 

 

 

onDrop

<left expN>
<top expN>
<type expC>
<name expC>

When the mouse button is released over the Container's display area during a Drag&Drop operation

 

The following table lists the common properties, events, and methods of the Container class:

Property

 

Event

 

Method

before
borderStyle

dragEffect

enabled

first

form

height

hWnd

left

mousePointer
name

pageno

parent

printable

speedTip

systemTheme

top

visible

width

beforeRelease
canRender

onClose
onDesignOpen
onDragBegin
onLeftDblClick
onLeftMouseDown
onLeftMouseUp
onMiddleDblClick

onMiddleMouseDown
onMiddleMouseUp

onMouseMove

onOpen

onRender

onRightDblClick

onRightMouseDown

onRightMouseUp

drag( )
move( )

release( )

Description

Use the Container object to create groups of controls, a custom control that contains multiple controls, or to otherwise group controls in a form. When a control is dropped in a Container object, it becomes a child object of the Container object. Its parent property references the container, while its form property references the form.

To make the rectangle that contains the controls invisible, set the borderStyle property to None (3) and the transparent property to true.

When the Container's enabled property is set to "false", the enabled properties of all contained controls are likewise set to "false". When the Container's enabled property is set to "true", the enabled properties of the contained controls regain their individual settings.