mshflexgrid1.rows=3
mshflexgrid1.FixedRows=2 然后通过合并列实现!

解决方案 »

  1.   

    帮你写好的代码:
    Private Sub Command1_Click()
    With MSHFlexGrid1
        .Clear
        .Rows = 3
        .FixedRows = 2
        .MergeCells = flexMergeFree
        .FormatString = "序号|客户编号|客户名称|应收账款|应收账款"
        .TextMatrix(1, 0) = "序号"
        .TextMatrix(1, 1) = "客户编号"
        .TextMatrix(1, 2) = "客户名称"
        .TextMatrix(1, 3) = "发票额"
        .TextMatrix(1, 4) = "结算额"
        
        .MergeRow(0) = True
        .MergeCol(0) = True
        .MergeCol(1) = True
        .MergeCol(2) = True
        
        End With
    End Sub
      

  2.   

    帮你写好的代码:
    Private Sub Command1_Click()
    With MSHFlexGrid1
        .Clear
        .Rows = 3
        .FixedRows = 2
        .MergeCells = flexMergeFree
        .FormatString = "序号|客户编号|客户名称|应收账款|应收账款"
        .TextMatrix(1, 0) = "序号"
        .TextMatrix(1, 1) = "客户编号"
        .TextMatrix(1, 2) = "客户名称"
        .TextMatrix(1, 3) = "发票额"
        .TextMatrix(1, 4) = "结算额"
        
        .MergeRow(0) = True
        .MergeCol(0) = True
        .MergeCol(1) = True
        .MergeCol(2) = True
        
        End With
    End Sub