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
'MSHFlexGrid1是不能输入的,只有通过一个text来输入Private Sub MSHFlexGrid1_Click()
Dim i As Long
With MSHFlexGrid1
If .Col = 1 Then
Text1.Text = Trim(.Text)
Text1.Left = .CellLeft - 10
Text1.Top = .CellTop - 10
Text1.Height = .CellHeight
Text1.Width = .CellWidth
Text1.Visible = True
Text1.SetFocus
Else
Text1.Visible = False
End If
End With
End Sub
Private Sub Text1_Change()
With MSHFlexGrid1
.Text = Trim(Text1.Text)
End With
End Sub
简单你取数据的时候把一共有多少条数据也一起算出来.
假设定义为AllRows
然后定义行数的时候这样写就OK了
Grid.Rows = Number(AllRows)+1
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)