Clipproperty
Returns or sets the contents of the cells in the MSHFlexGrid's selected region.
Syntax
PROPERTY Clip () AS DWSTRING
PROPERTY Clip (BYREF wszClip AS WSTRING)
Parameters
| Name | Description | |
|---|---|---|
wszClip | One of the constants listed below. |
Description
Returns or sets the contents of the cells in the MSHFlexGrid's selected region.
Remarks
It allows you to get or set the contents of a selected range of cells using a single string.
The Clip property operates exclusively on the current selection, defined by the Row, Col, RowSel, and ColSel properties.
By default, tab characters (CHR(9)) indicate column breaks, and carriage returns (CHR(13)) indicate row breaks.
Clip is significantly faster than using TextMatrix in a loop because it minimizes the number of individual property calls.
A critical use case for legacy maintenance is overcoming a bug where bound MSHFlexGrids only display the first 2,048 rows. By using the GetString method of an ADO Recordset, you can transfer thousands of rows into the grid instantly:
Clipboard interaction: It is the standard property for implementing Copy and Paste functionality. You can move data to the system clipboard by simply assigning Clip to Clipboard.SetText.
Example
' Example: Populating a grid with 5,000 rows grid.Rows = 5000 grid.Col = 0: grid.Row = 1 grid.ColSel = 5: grid.RowSel = 4999 grid.Clip = rs.GetString(adClipString)
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid