ColWordWrapOptionproperty
Controls how text wraps and behaves when it exceeds a cell's width.
Syntax
PROPERTY ColWordWrapOption (BYVAL Index AS LONG) AS WordWrapSettings
PROPERTY ColWordWrapOption (BYVAL Index AS LONG, BYVAL opt AS WordWrapSettings)
Parameters
| Name | Description | |
|---|---|---|
Index | The zero-based column index. | |
opt | An integer value or constant that defines how text is displayed: flexWordBreak: Normal word-breaking/wrapping. flexWordBreakEllipsis: Wraps text but appends an ellipsis ("...") if the text is still too long for the available space. |
Description
Returns or set how text wraps or is truncated within a specific column. Unlike the global WordWrap property, this provides per‑column control over wrapping behavior.
Remarks
Setting this property to enable wrapping does not automatically adjust the row height. You must manually set the RowHeight property for the wrapped text to be visible.
For standard word wrapping to occur, the text must contain spaces; otherwise, the control may simply truncate the string or require manual row height adjustments.
Examples
' Enable global word wrap first grid.WordWrap = True
' Set specific option for Column 0 grid.ColWordWrapOption(0) = flexWordBreakEllipsis
' Manually increase row height to see the wrapped content grid.RowHeight(1) = 1000
To enable wrapping with an ellipsis for the first column:
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid