Solved

MSFlexGrid Scrolling problem

Posted on 2004-10-06
2
793 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

705 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

18 Experts available now in Live!

Get 1:1 Help Now