我有这样的代码...
Dim sFileText As String
Dim Files As String
Dim iFileNo As Integer
Dim aray1() As String
Dim aray2() As String
Grid(1).Rows = 1
iFileNo = FreeFile
Files = Text1.Text
Open Files For Input As #iFileNo
Do While Not EOF(iFileNo)
Input #iFileNo, sFileText
aray1 = Split(sFileText, Chr(9))
For i = 0 To UBound(aray1) - 1
' MsgBox aray1(i)
Grid(1).Rows = Grid(1).Rows + 1
Grid(1).TextMatrix(Grid(1).Rows - 1, 0) = aray1(0)
Grid(1).TextMatrix(Grid(1).Rows - 1, 1) = aray1(1)
Grid(1).TextMatrix(Grid(1).Rows - 1, 2) = aray1(2)
Grid(1).TextMatrix(Grid(1).Rows - 1, 3) = aray1(3)
Grid(1).TextMatrix(Grid(1).Rows - 1, 4) = aray1(4)
Grid(1).TextMatrix(Grid(1).Rows - 1, 5) = aray1(5)
Next i
Loop
结果是这样的(对不起,我无法显示图像):
36 2012-10-20 08:59:34 1 255 1 0
36 2012-10-20 08:59:34 1 255 1 0
36 2012-10-20 08:59:34 1 255 1 0
36 2012-10- 20 08:59:34 1 255 1 0
36 2012-10-20 08:59:34 1 255 1 0
110 2012-10-20 09:45:00 1 255 1 0
110 2012-10-20 09:45: 00 1 255 1 0
110 2012-10-20 09:45:00 1 255 1 0
110 2012-10-20 09:45:00 1 255 1 0
110 2012-10-20 09:45:00 1 255 1 0
每个人都知道 MSFlexGrid 中每条记录只显示一次的代码吗?它在每条记录中显示 5 次..
PS:对不起英语不好:)