------------------------------------------------------------------------
 Auto Center Cell Sample for iGrid ActiveX
 
 Control Version: 5.0
 Environment: Visual Basic 6

 Copyright (c) 10Tec Company. All rights reserved.
------------------------------------------------------------------------

Description
===========
Sometimes you need to make a cell visible directly at the center of the grid. The code from this sample shows how to scroll the grid automatically in the horizontal and vertical direction to display the required cell in that position.

Short Code Explanation
======================
All work is done in the CenterCell procedure which can be easily attached to any existing iGrid.

In this procedure, iGrids CellBoundary method is used to get the coordinates of the specified cell. Then the coordinates of iGrids viewport area are determined with such calls to iGrids Sys function as Sys(igSysCellsAreaWidth) and Sys(igSysCellsAreaHeight).

After all required parameters have been retrieved, the algorithm calculates the scroll bar settings. Finally, iGrid is scrolled programmatically by assigning the calculated values to its VScrollBar.Value and HSCrollBar.Value properties.

Note that this universal code also works for rows and columns of different sizes.
