Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

LeftColumn

This property helps you figure out which columns of a grid are displayed. It always contains the ColumnOrder of the leftmost column currently showing.

Usage

nLeftmostColumn = grdGrid.LeftColumn

There’s no corresponding RightColumn property, nor is there a NumberOfColumnsDisplayed. The only way we can see to figure out exactly which columns are displayed is to start with LeftColumn and then look at ColumnWidths and the grid’s Width and figure it out the hard way.

You can’t change this property directly. Use the DoScroll method to change which columns are displayed.

Example

* Scroll if necessary to make sure Column2 is visible
IF This.LeftColumn>2
   LOCAL nCnt
   FOR nCnt = 1 TO This.LeftColumn - 2
      This.DoScroll(4)
   ENDFOR
ENDIF

See Also

ActiveColumn, ColumnOrder, DoScroll, RelativeColumn