Private Sub vsflexgrid1_afterScroll(ByVal oldTopRow As Long, ByVal oldLeftCol As Long, ByVal NewTopRow As Long, ByVal NewLeftCol As Long)Dim restdata As New adodb.Recordset
if restdata.RecordCount >10 then '当总行数大于10时
If NewTopRow <> oldTopRow Then
Me.vsflexgrid2.TopRow = NewTopRow - 1
End Ifend if
End Sub
代码如下:
MSHFlexGrid1.TopRow = MSHFlexGrid1.Rows - 1
mshflexgrid1.row=mshflexgrid1.rows-1
mshflexgrid1.toprow=mshflexgrid1.row