property Items.CellSingleLine([Item as Variant], [ColIndex as Variant]) as Boolean

Retrieves or sets a value indicating whether the cell's caption is painted using one or more lines.

 TypeDescription 
   Item as Variant A long expression that indicates the item's handle.  
   ColIndex as Variant A long expression that indicates the column's index, a string expression that indicates the column's caption or the column's key.  
   Boolean A boolean expression that indicates whether the cell displays its caption using one or more lines.  

The control is able to display a cell using more lines. When the CellSingleLine is False, the height of the item is computed based on each caption in the item. By default the cell uses only a line to display its caption.  Use the <br> HTML tag inside the CellValue to break a line, if the CellValueFormat property is exHTML.  Use the Def property to specify that all cells in the column use multiple lines. If your control displays items with different heights the ScrollBySingleLine property should be True. Use the CellVAlignment property to specify the vertical cell's alignment. Use the ItemMaxHeight property to specify the maximum value for the item's height. Use the Refresh method to refresh the control. Use the ItemAllowSizing property to specify whether the user can resize the item at runtime.

The following VB sample displays the caption of the focused cell using multiple lines:

With G2antt1.Items
    .CellSingleLine(.FocusItem, 0) = True
End With

The following C++ sample displays the caption of the focused cell using multiple lines:

#include "Items.h"
CItems items = m_g2antt.GetItems();
items.SetCellSingleLine( COleVariant( items.GetFocusItem() ), COleVariant( long(0) ), FALSE );

The following VB.NET sample displays the caption of the focused cell using multiple lines:

With AxG2antt1.Items
    .CellSingleLine(.FocusItem, 0) = False
End With

The following C# sample displays the caption of the focused cell using multiple lines:

axG2antt1.Items.set_CellSingleLine(axG2antt1.Items.FocusItem, 0, false);

The following VFP sample displays the caption of the focused cell using multiple lines:

with thisform.G2antt1.Items
	.DefaultItem = .FocusItem
	.CellSingleLine( 0, 0 ) = .f.
endwith

Note: A cell is the intersection of an item with a column. All properties that has an Item and a ColIndex parameters are referring to a cell. The Item parameter represents the handle of an item, and the ColIndex parameter indicates an index ( a numerical value, see Column.Index property ) of a column , the column's caption ( a string value, see Column.Caption property ), or a handle to a cell. Here's few hints how to use properties with Item and ColIndex parameters:

G2antt1.Items.CellBold(, G2antt1.Items.ItemCell(G2antt1.Items(0), 0)) = True
G2antt1.Items.CellBold(G2antt1.Items(0), 0) = True
G2antt1.Items.CellBold(G2antt1.Items(0), "ColumnName") = True

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