刚刚看到这个问题,给你做一个,稍等。
没有点击【转移】按钮的界面
点击【转移】按钮的界面
启动与通用部分:
【转移】按钮单击事件:
启动与通用部分:
程序代码:
Dim AA Private Sub Form_Load() AA = Array("1 2 3 4", "5 9 10 11", "7 8 12 32", "99 10 12 77") With MSFlexGrid1 .Cols = 1 .Rows = 5 .TextMatrix(0, 0) = "A" .ColWidth(0) = 1200 For I = 1 To 4 .TextMatrix(I, 0) = AA(I - 1) Next I End With With MSFlexGrid2 .Cols = 1 .Rows = 1 End With End Sub
【转移】按钮单击事件:
程序代码:
Private Sub Command1_Click() Dim BB, CC, DD, EE BB = Split(MSFlexGrid1.TextMatrix(1, 0), " ", -1, 1) '使用Split将MSFlexGrid1第一列数据分解到数组BB中,下同 CC = Split(MSFlexGrid1.TextMatrix(2, 0), " ", -1, 1) DD = Split(MSFlexGrid1.TextMatrix(3, 0), " ", -1, 1) EE = Split(MSFlexGrid1.TextMatrix(4, 0), " ", -1, 1) MSFlexGrid2.Clear With MSFlexGrid2 .Cols = 5 .Rows = 5 .TextMatrix(0, 0) = "A" .TextMatrix(0, 1) = "B" .TextMatrix(0, 2) = "C" .TextMatrix(0, 3) = "D" .TextMatrix(0, 4) = "E" .ColWidth(0) = 1200 .ColWidth(1) = 700 .ColWidth(2) = 700 .ColWidth(3) = 700 .ColWidth(4) = 700 For I = 1 To 4 .TextMatrix(I, 0) = AA(I - 1) '循环列,添加第一列数据 .TextMatrix(1, I) = BB(I - 1) '循环行,添加第一行数据 .TextMatrix(2, I) = CC(I - 1) '循环行,添加第二行数据 .TextMatrix(3, I) = DD(I - 1) '循环行,添加第三行数据 .TextMatrix(4, I) = EE(I - 1) '循环行,添加第四行数据 Next I End With End Sub
[此贴子已经被作者于2016-5-20 17:15编辑过]
请不要选我!!!