method Items.MergeCells ([Cell1 as Variant], [Cell2 as Variant], [Options as Variant])
Merges a list of cells.

 TypeDescription 
   Cell1 as Variant A long expression that indicates the handle of the cell being merged, or a safe array that holds a collection of handles for the cells being merged. Use the ItemCell property to retrieves the handle of the cell. The first cell (in the list, if exists) specifies the cell being displayed in the new larger cell.  
   Cell2 as Variant A long expression that indicates the handle of the cell being merged, or a safe array that holds a collection of handles for the cells being merged. Use the ItemCell property to retrieves the handle of the cell. The first cell in the list specifies the cell being displayed in the new larger cell.  
   Options as Variant Reserved.  
The MergeCells method combines two or more cells into one cell. The data in the first specified cell is displayed in the new larger cell. All the other cells' data is not lost. Use the CellMerge property to merge or unmerge a cell with another cell in the same item. Use the ItemDivider property to display a single cell in the entire item. Use the UnmergeCells method to unmerge the merged cells. Use the CellCaption property to specify the cell's caption. Use the ItemCell property to retrieves the handle of the cell. Use the BeginMethod and EndUpdate methods to maintain performance, when merging multiple cells in the same time. The MergeCells methods creates a list of cells from Cell1 and Cell2 parameters that need to be merged, and the first cell in the list specifies the displayed cell in the merged cell.

The following sample adds three columns to a group, a root item and few child items:

( Notice that the caption of the root item is truncated by the column that belongs to ).

If we are merging the first three cells in the root item we get:

You can merge the first three cells in the root item using any of the following methods:


Send comments on this topic.
1999-2015 Exontrol.COM, Software. All rights reserved.