读者您好:
可以使用MSHFlexGrid表格控件,以及它的合并功能,参考代码如下:
Private Sub Form_Load()
With MSHFlexGrid1
.Rows = 6
.Cols = 9
For i = 0 To 5
.RowHeight(i) = 350
Next i
For i = 1 To 6
.ColWidth(i) = 1000
Next i
.ColWidth(7) = 2200
.ColWidth(8) = 2200
For i = 2 To 5
For A = 3 To 4
.Col = A
.Row = i
.CellForeColor = &HFF&
Next A
Next i
.MergeCells = flexMergeFree
.TextMatrix(0, 0) = "序列"
.TextMatrix(1, 0) = "序列"
.TextMatrix(0, 1) = " 正行程压力/输出"
.TextMatrix(0, 2) = " 正行程压力/输出"
.TextMatrix(0, 3) = " 正行程压力/输出"
.TextMatrix(1, 1) = "0"
.TextMatrix(1, 2) = "0"
.TextMatrix(1, 3) = "0"
.TextMatrix(0, 4) = " 反行程压力/输出"
.TextMatrix(0, 5) = " 反行程压力/输出"
.TextMatrix(0, 6) = " 反行程压力/输出"
.TextMatrix(1, 4) = "0"
.TextMatrix(1, 5) = "0"
.TextMatrix(1, 6) = "0"
.TextMatrix(0, 7) = "非线性Nonlinear Error"
.TextMatrix(1, 7) = "非线性Nonlinear Error"
.TextMatrix(0, 8) = "迟 滞Hysteresis error"
.TextMatrix(1, 8) = "迟 滞Hysteresis error"
.MergeCol(0) = True
.MergeCol(7) = True
.MergeCol(8) = True
.MergeRow(0) = True
End With
End Sub
具体再结合你自己的程序,由于不是本书问题,我们只能给您这个开发思路。