Share via


ColAlignment, ColAlignmentBand, ColAlignmentHeader Properties (ModHFGrid)

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

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(Index) [=value]
object.ColAlignmentBand(BandNumber, BandColIndex) [=value]
object.ColAlignmentHeader(BandNumber, BandColIndex) [=value]

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

Part Description
object An object expression that evaluates to the ModHFGrid Control object.
Index
BandNumber
Required. A Long value that specifies the number of the band in the ModHFGrid.
BandColIndex Required. A Long value that specifies the number of the column in the ModHFGrid.
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 ModHFGrid is in vertical mode, the setting ColAlignment(3) might affect columns in multiple bands.

Example

The following code sets the alignment of the third column to right, center using the constant value.

Sub Form1_Load ()
   ModHFGrid1.ColAlignment(3) =flexAlignRightCenter
End Sub

See Also

CellAlignment Property (ModHFGrid) | FormatString Property (ModHFGrid) | ModHFGrid Control