alignChildren

Type: Integer

Availability: Read or write at any time

The alignChildren property of the Frame class and JadeDockBar class enables the frame or dock bar control to align child controls placed inside the frame or dock bar. The controls are automatically resized when the frame or dock bar resizes. If the three-dimensional (3D) effects are turned on for a Frame control, the children are placed inside the 3D border area.

For details about floating and docking container controls, see "Floating a Docking Control" and "Docking a Control", under the "JadeDockBase Class", earlier in this document. See also the docking examples under the allowDocking property, later in this document.

The settings of the Frame class alignChildren property are listed in the following table.

Frame Class Constant Value Description
AlignChildren_None 0 No alignment is performed (the default). Resizes of the frame have no effect.
AlignChildren_Width 1 Aligns width. When the frame is resized, each child control is sized to exactly fit the width of the client area of the frame (the area inside the 3D border).
AlignChildren_All 2 Aligns all. When the frame is resized, any child controls are also resized to exactly fit the height and width of the client area of the frame. If there is more than one child, they are all aligned.

Use this property to place a Frame in a form with the alignContainer property set to AlignChildren_All (2).

When a ListBox control is placed inside the frame and the alignChildren property set to AlignChildren_All, the frame and the list box are resized to fit when the form is resized.

By turning off the 3D effects and the frames border, the entire frame can be hidden and yet still make use of the alignment features.

The integralHeight property of TextBox and ListBox controls is ignored if the parent of those controls has the alignChildren property set.

Some controls, such as a check box, do not permit their size (usually the height) to change. The recalculation of the positions of the children occurs only if the size or position of the frame is altered. Changing the size and position of a child does not reposition the set of child controls within the frame, unless that child is also a frame control. To force the realignment, change to the size and position of the frame, or set the alignChildren property within logic (even if unchanged).

Dock controls that are aligned to their parent by using the JadeDockBar class alignChildren or alignContainer property and that have scroll bars are not scrolled and remain in place in their parent when the scroll bar of the parent is shifted. They therefore remain visible and unchanged when the scroll bar of the parent is adjusted.

The settings of this property for the JadeDockBar class are listed in the following table.

JadeDockBar Class Constant Integer Value
AlignChildren_None 0
AlignChildren_AllHorizontal 1
AlignChildren_AllVertical 2
AlignChildren_Auto 3

For the JadeDockBar class, the AlignChildren_None (0) constant value has the following rules.

If the alignChildren property is not set to AlignChildren_Auto and the width of the control is greater that its height and the control is dragged to a left or right docking position (and it is not currently docked left or right), the values of width and height properties are exchanged when considering the docking position.

Similarly, if the height of the control is greater than its width and the control is dragged to a top or bottom docking position (and it is not currently docked top or bottom), the values of width and height properties are exchanged when considering the docking position. This is necessary because the control does not know how to resize itself. For example, if the control were docked at the top and then dragged to the left position and these exchanges were not done, the control would retain its current width, stretch its height, and therefore probably use all of the space in its parent.

For the JadeDockBar class, the AlignChildren_AllHorizontal (1) constant value has the following rules.

For the JadeDockBar class, the AlignChildren_AllVertical (2) constant value has the following rules.

For the JadeDockBar class, the AlignChildren_Auto (3) constant value has the following rules.