ColAlignment, ColAlignmentBand, ColAlignmentHeader Properties (MSHFlexGrid)

       

Returns or sets the alignment of data in a column. This can be a standard column, a column within a band, or a column within a header. This property is not available at design time (except indirectly through the FormatString property).

Syntax

object.ColAlignment(number) [=value]
object.ColAlignmentBand(number) [=value]
object.ColAlignmentHeader(number) [=value]

Syntax for the ColAlignment, ColAlignmentBand, and ColAlignmentHeader properties has:

Part Description
object An object expression that evaluates to an object in the Applies To list.
number A Long value that specifies the number of the column in the MSHFlexGrid.
value An integer or constant that specifies the alignment of data in a column, as described in Settings.

Settings

The settings for value are:

Constant Value Description
flexAlignLeftTop 0 The column content is aligned left, top.
flexAlignLeftCenter 1 Default for strings. The column content is aligned left, center.
flexAlignLeftBottom 2 The column content is aligned left, bottom.
flexAlignCenterTop 3 The column content is aligned center, top.
flexAlignCenterCenter 4 The column content is aligned center, center.
flexAlignCenterBottom 5 The column content is aligned center, bottom.
flexAlignRightTop 6 The column content is aligned right, top.
flexAlignRightCenter 7 Default for numbers. The column content is aligned right, center.
flexAlignRightBottom 8 The column content is aligned right, bottom.
flexAlignGeneral 9 The column content is of general alignment. This is "left, center" for strings and "right, center" for numbers.

Remarks

Any column can have an alignment that is different from other columns. The ColAlignment property affects all cells in the specified column, including those in fixed rows.

To set individual cell alignments, use the CellAlignment property. To set column alignments at design time, use the FormatString property.

If the MSHFlexGrid is in vertical mode, the setting ColAlignment(3) may affect columns in multiple bands.