Share via


Col, Row 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.

Returns or sets the coordinates of the active cell in a ModHFGrid. These properties are not available at design time.

Syntax

object.Col [=number]
object.Row [=number]

Syntax for the Col and Row properties has these parts:

Part Description
object An object expression that evaluates to the ModHFGrid Control object.
number A Long value that specifies the position of the active cell.

Remarks

Use these properties to specify a cell in a ModHFGrid or to determine which row or column contains the current cell. Columns and rows are numbered from 0 — rows are numbered from top to bottom, and columns are numbered from left to right.

Setting these properties automatically resets RowSel and ColSel — the selection becoming the current cell. Therefore, to specify a block selection, you must set Row and Col first and then set RowSel and ColSel.

The value of the current cell, defined by the Col and Row settings, is the text contained in that cell. To modify a cell's value without changing the selected Row and Col properties, use the TextMatrix property.

Example

This example puts the word "Here" into the current cell, changes the active cell to the third cell in the third row, and puts the word "There" into this new active cell. To run the program, press F5, and then click the grid.

Private Sub Form1_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

Bands Property (ModHFGrid) | ColSel, RowSel Properties (ModHFGrid) | SelChange Event (ModHFGrid) | Sort Property (ModHFGrid) | Text Property (ModHFGrid) | TextMatrix Property (ModHFGrid) | ModHFGrid Control