Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MSFlexGrid Scrolling problem

Posted on 2004-10-06
2
Medium Priority
?
826 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 400 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

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…
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 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…
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…
Suggested Courses

783 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