CellAlignment Property

Returns or sets the alignment of text in the selected cell or range.

Syntax

[form!]VSFlexGrid.CellAlignment[ = AlignmentSettings ]

Remarks

Valid settings for the CellAlignment property are:

 

Constant

Value

FlexAlignLeftTop

0

FlexAlignLeftCenter

1

FlexAlignLeftBottom

2

FlexAlignCenterTop

3

FlexAlignCenterCenter

4

FlexAlignCenterBottom

5

FlexAlignRightTop

6

FlexAlignRightCenter

7

FlexAlignRightBottom

8

FlexAlignGeneral

9

Changing this property affects the current cell or the current selection, depending on the setting of the FillStyle property. To set the alignment of an arbitrary range of cells (not necessarily the current selection), use the Cell property instead.

This sample selects the first seven cells in column 3 and centers the text.

  With fg

      'select rows 1 through 7 in Column 3

      .Select 1, 3, 7, 3

      .FillStyle = flexFillRepeat

      .CellAlignment = flexAlignCenterCenter

      'return .FillStyle to its default (if needed)

      .FillStyle = flexFillSingle

  End With

Data Type

AlignmentSettings (Enumeration)

See Also

VSFlexGrid Control