我用MSFlexGrid显示,怎么有的格靠左对齐,有的靠右对齐呢?

解决方案 »

  1.   

    去查下MSDN上面有帮助此控件有此属性!可能是CellTextStyle或者CellAlignment
    具体的值在MSDN中也有
      

  2.   

    For I = 0 To MSFlexGrid1.Cols
        MSFlexGrid1.ColAlignment(I) = 4  '设置列的对齐方式
    Next'MSFlexGrid1.CellAlignment = 4   '对其方式为中间中间
    '1                               '对其方式为左对齐
    '6                               '对其方式为右对齐
      

  3.   

    For I = 0 To MSFlexGrid1.Cols-1
        MSFlexGrid1.ColAlignment(I) = 4  '设置列的对齐方式
    Next'MSFlexGrid1.CellAlignment = 4   '对其方式为中间中间
    '1                               '对其方式为左对齐
    '6                               '对其方式为右对齐
      

  4.   


    ColAlignment 设置列的对齐方式CellAlignment 设置单元格的对齐方式
      

  5.   

    ColAlignment 设置列的对齐方式CellAlignment 设置单元格的对齐方式
    楼上说的没错,就是这样。属性等于常量,常量可以看一下msdn。
      

  6.   

    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.