ColPosproperty
Returns the distance, intwips, between the upper-left corner of the control and the upper-left corner of a specified column.
Syntax
PROPERTY ColPos (BYVAL Index AS LONG) AS LONG
Parameters
| Name | Description | |
|---|---|---|
Index | The 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
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid