Wrox Programmer Forums
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 20th, 2006, 06:18 AM
Registered User
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default return to a row msflexgrid

Hi everyone,
I'm new to this forum and I have this problem in VB.
I'm using a lot of MSFlexgrid in my programming, and I don't know how to figure this out:

I have a form whit A Flexgrid on, which is filled with a lot of data. It works fine, and I offer my users the possibility to click on a row and after they have done this they get a new form. In that form the data of the selected row in the flexgrid is displayed (and many other things).
My problem is : Is there a way that the focus in the flexgrid is set back to the previous selected row when the users closes the second form and returns to the first form. This way they don't have to search again and scroll down the whole flexgrid again. Sometimes my grid gets populated with 18000 lines! For example if I want to see the details of row 11500 I scroll down and when I return the focus is back to the top.
I hope this is clear to everyone.
Can somebody help me?


Old January 20th, 2006, 03:00 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts

why does the grid scroll when you return to the first form? It should not do it unless you repopulate it.
Anyway, use the TopRow property to scroll back:

dim ltop as long
ltop = grid.toprow
''' display the second form here
grid.toprow = ltop

Old January 23rd, 2006, 06:46 AM
Registered User
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks man my problem is solved. If I had known it was that simple....
Yes I repopulate the form everytime... that was my problem.

Similar Threads
Thread Thread Starter Forum Replies Last Post
MSFlexGrid in VC++ arun.sharma.kumar Visual C++ 0 March 24th, 2007 02:27 AM
MSFlexGrid loveperson Beginning VB 6 1 January 18th, 2005 11:45 AM
Problems with MSFlexgrid amerk20 Access VBA 2 March 23rd, 2004 03:35 PM
MsFlexGrid vs. DataGrid - which ? mike123abc SQL Server 2000 3 November 19th, 2003 11:19 PM
MSFlexGrid meireliezer Visual C++ 0 November 19th, 2003 07:36 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.