ColWidth2function
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
FUNCTION ColWidth2 (BYVAL Index AS LONG, BYVAL BandNumber AS LONG = 0) AS LONG
FUNCTION ColWidth2 (BYVAL Index AS LONG, BYVAL BandNumber AS LONG = 0, BYVAL nWidth AS LONG) AS HRESULT
Also documented as
ColWidth — one description covers them all.Parameters
| Name | Description | |
|---|---|---|
Index | A Long value that specifies which column's width to change. To set the same width for all columns at once, use an index of -1. | |
nWidth | A numeric expression that specifies the width of the specified column, in twips. Setting the width to 0 hides the column from the user. | |
BandNumber | Optional. A Long value that specifies the band that contains the column. | |
Index | The zero-based index of the row being checked. |
Description
Returns or sets the width of the column in the specified band, in twips.
Examples
' Set a specific width for the first column (Index 0) grid.ColWidth(0) = 2000
' Hide the third column (Index 2) grid.ColWidth(2) = 0
' Set all columns to a standard uniform width grid.ColWidth(-1) = 1200
' Example: If Row 50 is not visible, scroll to it If Not grid.RowIsVisible(50) Then
grid.TopRow = 50
End If
Dim i As Long, count As Long For i = grid.TopRow To grid.Rows - 1 If grid.RowIsVisible(i) Then
count = count + 1
Else
Exit For
End If Next
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid