Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSFlexgrid and Scrolling 1

Status
Not open for further replies.

aberry

MIS
Jun 6, 2002
24
0
0
I am loading records manually into a flexgrid and depending on what data the user enters I am selecting the row. This all works good and well.

The problems occurs with selecting the record programatically, because there are so many records being entered there is a scroll bar and the highlighted record is sometimes not actually in focus on the screen.

Is there a way round this?

Thanks,

Andrew
 
If you are using MSHFlexgrid, there is a TopRow property which sets or returns the top visible row.

Look up details in VBHelp Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Similarly, you can use the LeftCol property to set the left most visible column if you have a grid that needs to scroll horizontally.

Note that neither of these properties is available at design time so they don't appear in the IDE but nonetheless are available at run time for both MSFlexGrid and MSHFlexGrid controls.
 
many thanks for the help guys, works a treat :)

The following code did it:-

iHeight = (MSFlexGrid1.Height / MSFlexGrid1.CellHeight) / 2

If MSFlexGrid1.Row > iHeight Then
MSFlexGrid1.TopRow = MSFlexGrid1.Row - iHeight
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top