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.
具体的值在MSDN中也有
MSFlexGrid1.ColAlignment(I) = 4 '设置列的对齐方式
Next'MSFlexGrid1.CellAlignment = 4 '对其方式为中间中间
'1 '对其方式为左对齐
'6 '对其方式为右对齐
MSFlexGrid1.ColAlignment(I) = 4 '设置列的对齐方式
Next'MSFlexGrid1.CellAlignment = 4 '对其方式为中间中间
'1 '对其方式为左对齐
'6 '对其方式为右对齐
ColAlignment 设置列的对齐方式CellAlignment 设置单元格的对齐方式
楼上说的没错,就是这样。属性等于常量,常量可以看一下msdn。
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.