VSFlexGrid Control > VSFlexGrid Properties, Events, and Methods > VSFlexGrid Methods > Select Method |
Selects a range of cells.
[form!]VSFlexGrid.Select Row As Long, Col As Long, [ RowSel As Long ], [ ColSel As Long ]
The Select method allows you to select ranges or cells (by omitting the last two parameters) with a single command.
The following code selects the entire scrollable (data) part of the control:
fg.Select _
fg.FixedRows, fg.FixedCols, fg.Rows - 1, fg.Cols - 1
This method is more efficient than setting the Row, Col, RowSel, and ColSel properties separately and makes the code more readable.
You may use the GetSelection method to retrieve the current selection.