VSFlexGrid Control > VSFlexGrid Properties, Events, and Methods > VSFlexGrid Properties > ColSel Property |
Returns or sets the extent of a range of columns.
[form!]VSFlexGrid.ColSel[ = value As Long ]
Use the RowSel and ColSel properties to modify a selection or to determine which cells are currently selected. Columns and rows are numbered from zero, beginning at the top for rows and at the left for columns.
Setting the Row and Col properties automatically resets RowSel and ColSel, so the selection becomes the current cell. Therefore, to specify a block selection, you must set Row and Col first, then set RowSel and ColSel. Alternatively, you may use the Select method to do it all with a single statement.
If the SelectionMode property is set to flexSelectionListBox (3), you should use the IsSelected property to select and deselect rows.
Note that when a range is selected, the value of Row may be greater than or less than RowSel, and Col may be greater than or less than ColSel. This is inconvenient when you need to set up bounds for loops. In these cases, use the GetSelection method to retrieve selection in an ordered fashion.
Long