Solved

Detecting Which ScrollBar In a VSFlexGrid

Posted on 2000-03-15
3
734 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
ID: 2620173
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
ID: 2689071
jegb, I am posting an answer to see if this has worked for you.
0
 

Author Comment

by:JEGB
ID: 2708608
Ta Tim, forgot to accept your answer, many thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

861 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

29 Experts available now in Live!

Get 1:1 Help Now