property Items.CaptionFormat(Index as Long, ColIndex as Variant) as CaptionFormatEnum
Specifies how the cell's caption is displayed.

 TypeDescription 
   Index as Long A long expression that specifies the index of 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.  
   CaptionFormatEnum A CaptionFormatEnum expression that indicates the cell's format.  

The component supports built-in HTML format. That means that you can use HTML tags when displays the cell's caption . By default, the CaptionFormat property is exText. If the CaptionFormat is exText, the cell displays the Caption property without HTML format. If the CaptionFormat is exHTML, the cell displays the Caption property using the HTML tags specified in the CaptionFormatEnum type. Use the Def property to specify that all cells in the column display HTML format. Use ItemBold, ItemItalic, ItemUnderline or ItemStrikeOut property to apply different font attributes to the item. Use the CellItalic, CellUnderline, CellBold or CellStrikeOut property to apply different font attributes to the cell. Use the CaptionFormat property on exComputedField to indicate a computed field. Use the ComputedField property to specify a formula for the entire column.

The following VB sample adds a built-in HTML cell:

Dim i As Long
With List1.Items
    i = .Add("This is a built-in <b>HTML</b> cell.")
    .CaptionFormat(i, 0) = exHTML
End With

The following C++ sample adds a built-in HTML cell:

CItems items = m_list.GetItems();
int i = items.Add( COleVariant("This is a built-in <b>HTML</b> cell." ) );
items.SetCaptionFormat( i, COleVariant( long(0) ), 1 );

The following VB.NET sample adds a built-in HTML cell:

With AxList1.Items
    Dim i As Integer = .Add("This is a built-in <b>HTML</b> cell.")
    .CaptionFormat(i, 0) = EXLISTLib.CaptionFormatEnum.exHTML
End With

The following C# sample adds a built-in HTML cell:

EXLISTLib.Items items = axList1.Items;
int i = items.Add("This is a built-in <b>HTML</b> cell.");
items.set_CaptionFormat(i, 0, EXLISTLib.CaptionFormatEnum.exHTML );

The following VFP sample adds a built-in HTML cell:

With thisform.List1.Items
	local i
    i = .Add("This is a built-in <b>HTML</b> cell.")
    .CaptionFormat(i, 0) = 1 && exHTML
EndWith

 

 


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