ColAlignmentBandfunction
Returns or sets the alignment of data in a column within a band.
Syntax
FUNCTION ColAlignmentBand (BYVAL BandNumber AS LONG, BYVAL BandColIdx AS LONG) AS SHORT
FUNCTION ColAlignmentBand (BYVAL BandNumber AS LONG, BYVAL BandColIdx AS LONG = -1, BYVAL nAlignment AS SHORT) AS HRESULT
FUNCTION ColAlignmentBand (BYVAL BandColIdx AS LONG) AS SHORT
FUNCTION ColAlignmentBand (BYVAL BandColIdx AS LONG = -1, BYVAL nAlignment AS SHORT) AS HRESULT
Parameters
| Name | Description | |
|---|---|---|
BandNumber | A zero‑based index identifying the band whose data alignment is being retrieved or modified. If the band number is omited, band 0 is assumed. | |
Index | The number of the column. | |
nAlignment | An integer or constant that specifies the alignment of data in a column. |
Description
Returns or sets the alignment of data within a specific column of a hierarchical band.
Remarks
While the standard ColAlignment property affects an entire column across the whole grid, ColAlignmentBand allows for granular control over how data is positioned in nested data levels (bands) created from hierarchical ADO recordsets.
This property is used in applications that use complex, multi-level data displays. It specifically targets the data cells within a band. To align the headers for that same band, you must use the companion property: ColAlignmentHeader. Settings made with ColAlignmentBand will generally take precedence over the more global ColAlignment property for those specific band members.
Example
' Center-align the 2nd column of the first child band (Band 1) grid.ColAlignmentBand(1, 1) = flexAlignCenterCenter
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid