我想实现通过滚轮翻页, 下面这段程序 为什么会走三遍 ?
Private Sub FpSpread2TopChange(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.TopChangeEventArgs) Handles FpSpread2.TopChange
If FpSpread2.GetViewportTopRow(0) > oldViewportTopRow2 Then
If oldViewportTopRow2 = -1 Then
oldViewportTopRow2 = 0
End If
Me.FpSpread2.SetViewportTopRow(0, oldViewportTopRow2 + 20) -------------①
Me.FpSpread2.SetViewportLeftColumn(0, 0)
Me.FpSpread2_Sheet1.ActiveRowIndex = oldViewportTopRow2 + 20
ElseIf FpSpread2.GetViewportTopRow(0) < oldViewportTopRow2 Then
Me.FpSpread2.SetViewportTopRow(0, oldViewportTopRow2 - 20)
Me.FpSpread2.SetViewportLeftColumn(0, 0)
Me.FpSpread2_Sheet1.ActiveRowIndex = oldViewportTopRow2 - 20
End If
oldViewportTopRow2 = FpSpread2.GetViewportTopRow(0)
End Sub --------------------------------------------------------------------------------------②
第一次走到①、跳回程序开头, 第二次走到②、却跳回①了、又接着走完。为啥 ? |
|