VB 6.0中使用msflexgrid控件,如何插入一行?

最好提供代码
2025-01-03 01:26:21
推荐回答(1个)
回答1:

msflexgrid.Rows = msflexgrid.Rows + 1

For i = msflexgrid.Rows - 1 To msflexgrid.Row + 2 Step -1
For j = 0 To msflexgrid.Cols - 1
msflexgrid.TextMatrix(i, j) = msflexgrid.TextMatrix(i - 1, j)
Next
Next
msflexgrid.Row = msflexgrid.Row + 1
For i = msflexgrid.Row To msflexgrid.Row
For j = 0 To msflexgrid.Cols - 1
msflexgrid.TextMatrix(i, j) = ""
Next
Next