Solved

MSFlexGrid Scrolling problem

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel Vlookup to move data back to source. 4 92
Concatenate 2 userform comboboxes to a userform text box 4 64
Copy a row 12 62
how to Classify of email (pdf attachments) 7 36
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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

832 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