#2
apull2023-10-28 12:14
|
以下是模块代码,显示编译错误,请各位大神帮忙看看问题在哪?
' 移动记录类型的枚举
Public Enum moveType
FirstRecord = 12
PreviousRecord = 13
NextRecord = 14
LastRecord = 15
End Enum
' 函数名:MoveRecord
' 函数功能:控制表格记录前后移动
' 参数说明:moveType 移动记录类型(使用MoveType枚举)
' vsf 表格控件
' 返回值:无
Public Sub MoveRecordA(moveType As moveType, ByVal vsf As VSFlexGrid)
Dim H As Integer
With vsf
H = (.Height \ .CellHeight) - 2
Select Case moveType
Case moveType.FirstRecord
If .Rows > .FixedRows Then
.Row = .FixedRows
.TopRow = .FixedRows
End If
Case moveType.PreviousRecord
If .Row > .FixedRows Then
.Row = .Row - 1
If .Row - .TopRow < 0 Then
.TopRow = .TopRow - 1
End If
End If
Case moveType.NextRecord
If .Row < .Rows - 1 Then
.Row = .Row + 1
If .Row - .TopRow > H - 1 Then
.TopRow = .TopRow + 1
End If
End If
Case moveType.LastRecord
If .Rows > .FixedRows + 1 Then
.Row = .Rows - 1
If .Rows > H Then
.TopRow = .Rows - H
End If
End If
End Select
' 处理超出可见范围的情况
If .Row - .TopRow < 0 Or .Row - .TopRow > H Then
.TopRow = Abs(.Row - H)
End If
End With
End Sub