Share via


Cols, Rows Properties (ModHFGrid)

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Cols returns or sets the total number of columns in a ModHFGrid.

Rows returns or sets the total number of rows in a ModHFGrid.

Syntax

object.Cols(BandNumber) [= value]
object.Rows [= value]

Syntax for the Cols and Rows properties has these parts:

Part Description
object An object expression that evaluates to the ModHFGrid Control object.
BandNumber Optional. A Long value that either specifies the band to get or sets the total number of columns.
value A Long value that specifies the number of columns or rows.

Remarks

You can use these properties to expand and shrink ModHFGrid dynamically at run time.

The minimum number of rows and columns is 0. The maximum number is limited by the memory available on your computer.

The value of Cols must be at least one greater than the value of FixedCols, unless they are both set to 0. The value of Rows must be at least one greater than the value of FixedRows, unless they are both set to 0.

When number is not specified, it defaults to 0. Therefore, when the ModHFGrid is not bound to a hierarchical Recordset, using 0 or not specifying number both have the same result.

Example

The following example places the word "Here" into the current cell, changes the active cell to the third cell in the third row, and then places "There" into that cell. To run the program, press F5, and then click your ModHFGrid.

Private Sub Form_Load ()
   ModHFGrid1.Rows = 8
   ModHFGrid1.Cols = 5
End Sub

Private Sub ModHFGrid1_Click ()
   ' Put text in current cell.
   ModHFGrid1.Text = "Here"
   ' Put text in third row, third column.
   ModHFGrid1.Col = 2
   ModHFGrid1.Row = 2
   ModHFGrid1.Text = "There"
End Sub

See Also

Col, Row Properties (ModHFGrid) | ColPosition, RowPosition Properties (ModHFGrid) | FormatString Property (ModHFGrid) | ModHFGrid Control