Solved

Detecting Which ScrollBar In a VSFlexGrid

Posted on 2000-03-15
3
738 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

813 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

14 Experts available now in Live!

Get 1:1 Help Now