property Items.CellSingleLine(Index as Long, ColIndex as Variant) as Boolean
Retrieves or sets a value indicating whether the cell's caption is painted using one or more lines.

 TypeDescription 
   Index as Long A long expression that indicates the index of the item.  
   ColIndex as Variant A long expression that indicates the column's index, or a string expression that indicates the column's caption or column's key.  
   Boolean A boolean expression indicating whether the cell's caption is displayed using one or more lines.  

By default the cell uses only a line to display its caption.  The control is able to display a cell using multiple lines. In this case, the height of the item has no effect because the control computes the item height based on the cell's captions. So, when an item contains at least a cell that has the CellSingleLine property to False, the control computes the item height. based on the cell caption. The <br> HTML tag breaks the line if the CaptionFormat property is exHTML. Use the ItemHeight property to specify the height of the item when it contains no cells with CellSingleLine property on False. Use the ItemMaxHeight property to specify the maximum height of the item when it contains cells with CellSingleLine property on False.  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 ItemAllowSizing property to specify whether the user can resize the item at runtime.

Use the Refresh method to refresh the control.

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

With List1.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_list.GetItems();
items.SetCellSingleLine( items.GetFocusItem() , COleVariant( long(0) ), FALSE );

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

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

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

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

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

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

 


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