我想把三列的表头合并在一起,这该如何做?

解决方案 »

  1.   

    可以,设置
    mshgrid.mergerow(0)=true
    mshgrid.mergecells=2
    前提是你三列表头是一样的
      

  2.   

    Private Sub Form_Load()
    Dim i As Integer
    With MSFlexGrid1
    .Cols = 3
    .FixedCols = 0For i = 0 To 2
    .TextMatrix(0, i) = "head"
    .TextMatrix(1, i) = "1"
    .ColAlignment(i) = 3
    Next
    For i = 2 To 10
    .AddItem i & vbTab & i & vbTab & i
    Next
    .MergeCells = flexMergeRestrictRows
    .MergeRow(0) = TrueEnd With
    End Sub
      

  3.   

    我这里有一个例子,要吗?我给你发,请来信
    我的email:[email protected]
      

  4.   

    With HFGrid
            .MergeCells = flexMergeRestrictRows
        '第一列1、2行合并
            .Cols = 18
            .TextMatrix(0, 0) = "序号"
            .TextMatrix(1, 0) = "序号"
            .MergeRow(0) = True
            .MergeRow(1) = True
            .MergeCol(0) = True
        '第一行2、3两列合并
            .TextMatrix(0, 1) = "姓名"
            .TextMatrix(0, 2) = "姓名"
            .MergeRow(0) = True
            .MergeCol(1) = True
            .MergeCol(2) = True
        End With