VSFlexGrid Control > VSFlexGrid Properties, Events, and Methods > VSFlexGrid Events > AfterScroll Event |
Fired after the control scrolls.
Private Sub VSFlexGrid_AfterScroll( ByVal OldTopRow As Long, ByVal OldLeftCol As Long, ByVal NewTopRow As Long, ByVal NewLeftCol As Long)
This event is fired whenever the TopRow or LeftCol properties change, either as a result of user actions (keyboard or mouse) or through code.
For example, the following code ensures that a cell remains visible while it is being edited:
Private Sub fg_AfterScroll(ByVal OldTopRow As Long, _
ByVal OldLeftCol As Long, _
ByVal NewTopRow As Long, _
ByVal NewLeftCol As Long)
If fg.EditWindow <> 0 Then fg.ShowCell fg.Row, fg.Col
End Sub
You can prevent the user from scrolling the control by handling the BeforeScroll event and setting the Cancel parameter to True. You can control the visibility of the scrollbars using the ScrollBars property.