Solved

MSFlexGrid Scrolling problem

Posted on 2004-10-06
2
799 Views
Last Modified: 2013-12-26
Hi there one more time.

I have a form "FLLista" with MSFlexGrid with a list of customers. When user hits Return, it shows customer info in a form "FClients". In this form, hitting PageUp or PageDown keys, it shows previous / next customer in FClients, and I also change current row in MSFlexGrid, so when user closes FClients, it shows current customer in MSFlexGrid, with different cellbackcolor.

Problem is when it has moved several customers away from first one and MSFlexGrid has to do a scrolling (up or down). For example, say we have customer A to customer Z in a 20-rows MSFlexGrid. I see customer A info in FClients, and move forward to customer W. If I close FClients, I still see first 20 customers (A to T) in the MSFlexGrid listing. But if I hit up arrow, for example, then row changes to customer V (one previous to customer W), and it makes scrolling if necessary. So when I do the MSFlexGrid.row=MSFlexGrid.Row+1, it works, but if scrolling is needed when MSFlexGrid does not have the focus, then it's not doing it.

I wonder if there is something similar to the EnsureVisible property of the ListView.

Code in the KeyDown event:

If FLlista.MSFlexGrid1.Row < FLlista.MSFlexGrid1.Rows - 1 Then
    'change current row
    FLlista.MSFlexGrid1.Row = FLlista.MSFlexGrid1.Row + 1
End If
'stored procedure
Set RsLlistaC = CnPermanent.Execute("ae_findclientfromid " & FLlista.MSFlexGrid1.RowData(FLlista.MSFlexGrid1.Row))
'show customer in FClients
Call MostrarClient(RsLlistaC)


Thanks in advance for your time.

Alex.
0
Comment
Question by:AlexEspinal
2 Comments
 
LVL 5

Accepted Solution

by:
gary_j earned 100 total points
ID: 12238484
use the toprow property to set what is visible in the grid
0
 

Author Comment

by:AlexEspinal
ID: 12238699
Thanks gary_j. That is exactly what I needed.

I just added:
    FLlista.MSFlexGrid1.TopRow= FLlista.MSFlexGrid1.Row
when changing current row

It works perfect!!

Take care and thanks again.

Alex.

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

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…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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…

919 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

17 Experts available now in Live!

Get 1:1 Help Now