event FormatColumn (Group as Group, Item as HITEM, ColIndex as Long, Value as Variant)
Fired when a cell requires to format its caption.

 TypeDescription 
   Group as Group A Group object where the cell needs to be formatted  
   Item as HITEM A long expression that indicates the handle of the item being formatted.  
   ColIndex as Long A long expression that indicates the index of the column being formatted.  
   Value as Variant A Variant value that indicates the value being formatted. By default, the Value parameter has the CellCaption value.  
The FormatColumn event is fired only if the FireFormatColumn property of the Column object is True. The FormatColumn event lets the user provides the cell's caption before it being displayed on the group's list. For instance, the FormatColumn event is very useful when the column cells contains prices( numbers ), and you want to display that column formatted as currency, like $50 instead 50.

The following sample uses the FormatCurrency function provided by the VB to display numbers as currency:

Private Sub ExplorerTree1_FormatColumn(ByVal Group As EXPLORERTREELibCtl.IGroup, ByVal Item As EXPLORERTREELibCtl.HITEM, ByVal ColIndex As Long, Value As Variant)
    Value = FormatCurrency(Value)
End Sub


Private Sub Form_Load()
    With ExplorerTree1
        With .Groups.Add("Group 1")
            .BeginUpdate
                With .Columns(0)
                    .FireFormatColumn = True
                End With
                .PutItems Array(10, 20, 30, 40)
            .EndUpdate
        End With
    End With
End Sub


Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.