Solved

Detecting Which ScrollBar In a VSFlexGrid

Posted on 2000-03-15
3
731 Views
Last Modified: 2013-12-25
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?
0
Comment
Question by:JEGB
  • 2
3 Comments
 
LVL 43

Expert Comment

by:TimCottee
Comment Utility
You should be able to use the .TopRow and .LeftCol properties to determine which way the scroll event has occurred.

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
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 100 total points
Comment Utility
jegb, I am posting an answer to see if this has worked for you.
0
 

Author Comment

by:JEGB
Comment Utility
Ta Tim, forgot to accept your answer, many thanks.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now