ComponentOne Sizer 8.0
Using the Align Property

The Elastic's Align property is similar to the Align property provided by other controls such as the Picture Box control, but it provides additional settings and capabilities.

Like the standard Align property, the Elastic's Align lets you align the control to the top, bottom, left, or right of a form. In addition, the Elastic's Align property lets you align controls to fill the entire form when it is resized.

The other difference is that the standard Align property lets you align to forms only, while the Elastic's Align property lets you align to any container control, including other Elastics.

There is only one thing to remember when using the Elastic Align property: if several Elastics within the same container have their Align property set, the ones further behind get aligned first, and reduce the area available for the other controls. The pictures below illustrate this:

Both forms shown above have three Elastics, one aligned to the top, one to the left, and one that fills the container. The difference is that on Form1, the Elastic aligned to the top was created first. It aligned itself to the top and reduced the free area on the form. The second Elastic aligned itself to the left of the remaining area.

On Form2, the Elastic aligned to the left was created first. It aligned itself to the left and reduced the free area on the form. The second Elastic aligned itself to the top of the remaining area.

This does not mean that you have to create the Elastics in perfect order to use the Align property. Visual Basic's Format menu has options that allow you to send controls to the back or bring them to the top, changing the order in which they are aligned.

For example, if you selected the Elastic aligned to the left on Form1, then clicked on the Format|Order|Send To Back (ctrl-K) Visual Basic menu option, it would become identical to Form2. You can even change the order of the controls at runtime, using the ZOrder method.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback