假如VS表格有5行6列,现在我想将R1:C2到R3:C4的区域进行合并,我的代码是:
   With vsflexGrid
        .MergeCells = flexMergeFree
        .MergeCol(-1) = True
        .MergeRow(-1) = True
        .Cell(flexcpText, 1, 2, 3, 4) = "Test MergeCell"
        .Refresh
   End With
   
   上面执行的结果为什么只影响行,而列之间使终不能合并在一起?我哪里有错吗?

解决方案 »

  1.   

    Private Sub Form_Load()
        Dim i As Long    With sgrd
            .Cols = 5
            .Rows = 4
            For i = 1 To 4
                .TextMatrix(0, i) = "学生档案"
                .ColAlignment(i) = 4
            Next
            .TextMatrix(1, 0) = "序号"
            .TextMatrix(2, 0) = "2 "
            .TextMatrix(3, 0) = "2 "
            .TextMatrix(1, 1) = "姓名"
            .TextMatrix(1, 2) = "姓名"
            .TextMatrix(1, 3) = "性别"
            .TextMatrix(1, 4) = "年龄"
            .MergeCells = flexMergeRestrictRows
            .MergeRow(0) = True
            .MergeRow(1) = True
            .MergeCol(0) = True
        End With
    End Sub
      

  2.   

    楼上的Flc,你还没有明白我的意思,我是要将一个跨行、列的区域进行合并,我试了很久都不行,
    不会是VsflexGrid没有这样的特性吧?