Help Center

ColPosproperty

Returns the distance, intwips, between the upper-left corner of the control and the upper-left corner of a specified column.

Windowspropertydoc-orphan
No implementation located. This member is documented, but the source scan found no matching declaration. It is likely declared in a header this scan does not resolve, or provided by a macro.

Syntax

PROPERTY ColPos (BYVAL Index AS LONG) AS LONG

Parameters

NameDescription
IndexThe zero-based index of the column.

Description

Returns the distance, intwips, between the upper-left corner of the control and the upper-left corner of a specified column.

Remarks

The value returned is relative to the upper-left corner of the grid control.

ColPos returns the position based on the current scroll state. If a column is scrolled off to the left, its ColPos will be a negative value.

While ColPos returns a coordinate, the related ColPosition property is used to move a column to a different index location in the grid.

Developers use ColPos and RowPos to calculate the exact coordinates needed to place a standard TextBox or ComboBox over a cell, creating the illusion of a native editable grid.

It is used to determine where to display a popup or tooltip relative to a specific data column when a user hovers their mouse.

It helps position external icons, progress bars, or validation markers precisely over a column.

Reference