Solved

MSFlexGrid Scrolling problem

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

808 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