JEGB
asked on
Detecting Which ScrollBar In a VSFlexGrid
Within a VSFlexGrid there is a Scroll Event which is fired whenever the user uses either the vertical or the horizontal. I want to be able to tell which one it is since I want to execute some code only when the vertical scroll bar is used. There is no parameter in the event itself and I can't seem to locate any properties. Has anyone done/know how to do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ta Tim, forgot to accept your answer, many thanks.
If you store the initial values of these on the form_load or other populate.
intLeftCol = Grid.LeftCol
intTopRow = Grid.TopRow
In the Scroll event you can check:
Sub Grid_Scroll()
IF intLeftCol <> Grid.LeftCol Then
'Code for horiz scroll
intLeftCol = Grid.LeftCol
'Set for next scroll
End If
If intTopRow <> Grid.TopRow Then
'Code for vertical scroll
intTopRow = Grid.TopRow
'Set for next scroll
End If
End Sub