LeftCol Property

See AlsoBMVD42              Example1MCHC16>Low

Applies To



Determines the leftmost visible column (other than a fixed column) in the grid.  Not available at design time.


[form.]grid.LeftCol[ = numericexpression ]


You can use this property in code to scroll a grid programmatically.  Use the TopRow1247H93 property to determine the topmost visible row in the grid.

Data Type


See Also


Col, Row PropertiesL43H93

TopRow Property1247H93


Programmer's Guide:

Chapter 3, "Creating and Using Controls"

LeftCol Property Example

The example changes the LeftCol property with each click of the form.  To try this example, create a new project, add GRID.VBX using the Add File command on the File menu, and then draw a grid.  Copy the code into the Declarations section and press F5 to run the program.

Sub Form_Load ()

   Grid1.Rows = 8                  ' Set columns and rows.

   Grid1.Cols = 9

   Grid1.Row = 0

   For I = 1 To Grid1.Cols - 1     ' Set numbers in column heads.

      Grid1.Col = I

      Grid1.Text = I

   Next I

End Sub


Sub Form_Click ()

   On Error GoTo LeftColError

   ' Scroll the grid by one column.

   Grid1.LeftCol = Grid1.LeftCol + 1

   On Error GoTo 0

   Exit Sub



   Grid1.LeftCol = 1               ' Display the first column.

   Resume Next

End Sub