property Items.CellFont ([Item as Variant], [ColIndex as Variant]) as IFontDisp
Retrieves or sets the cell's font.

TypeDescription
Item as Variant A long expression that indicates the item's handle, or optional if the cell's handle is passed to ColIndex parameter
ColIndex as Variant A long expression that indicates the column's index or cell's handle, or a string expression that indicates the column's caption.
IFontDisp A Font object that indicates the cell's font.

By default, the CellFont property is nothing. If the CellFont property is noting, the cell uses the item's font.  Use the CellFont and ItemFont properties to specify different fonts for cells or items. Use the CellBold, CellItalic, CellUnderline, CellStrikeout, ItemBold, ItemUnderline, ItemStrikeout, ItemItalic or CellCaptionFormat to specify different font attributes. Use the Refresh method to refresh the control's content on the fly. Use the BeginUpdate and EndUpdate methods if you are doing multiple changes, so no need for an update each time a change is done. Use the ConditionalFormats method to apply formats to a cell or range of cells, and have that formatting change depending on the value of the cell or the value of a formula.

The following VB sample changes the font for the focused cell:

With Tree1.Items
    .CellFont(.FocusItem, 0) = Tree1.Font
    With .CellFont(.FocusItem, 0)
        .Name = "Comic Sans MS"
        .Size = 10
        .Bold = True
    End With
End With
Tree1.Refresh

The following C++ sample changes the font for the focused cell:

#include "Items.h"
#include "Font.h"
CItems items = m_tree.GetItems();
COleVariant vtItem(items.GetFocusItem()), vtColumn( (long)0 );
items.SetCellFont( vtItem, vtColumn, m_tree.GetFont().m_lpDispatch );
COleFont font = items.GetCellFont( vtItem, vtColumn );
font.SetName( "Comic Sans MS" );
font.SetBold( TRUE );
m_tree.Refresh();

The following VB.NET sample changes the font for the focused cell:

With AxTree1.Items
    .CellFont(.FocusItem, 0) = IFDH.GetIFontDisp(AxTree1.Font)
    With .CellFont(.FocusItem, 0)
        .Name = "Comic Sans MS"
        .Bold = True
    End With
End With
AxTree1.CtlRefresh()

where the IFDH class is defined like follows:

Public Class IFDH
    Inherits System.Windows.Forms.AxHost

    Sub New()
        MyBase.New("")
    End Sub

    Public Shared Function GetIFontDisp(ByVal font As Font) As Object
        GetIFontDisp = AxHost.GetIFontFromFont(font)
    End Function

End Class

The following C# sample changes the font for the focused cell:

axTree1.Items.set_CellFont( axTree1.Items.FocusItem, 0, IFDH.GetIFontDisp( axTree1.Font ) );
stdole.IFontDisp spFont = axTree1.Items.get_CellFont(axTree1.Items.FocusItem, 0 );
spFont.Name = "Comic Sans MS";
spFont.Bold = true;
axTree1.CtlRefresh();

where the IFDH class is defined like follows:

internal class IFDH : System.Windows.Forms.AxHost
{
	public IFDH() : base("")
	{
	}

	public static stdole.IFontDisp GetIFontDisp(System.Drawing.Font font)
	{
		return System.Windows.Forms.AxHost.GetIFontFromFont(font) as stdole.IFontDisp;
	}
}

The following VFP sample changes the font for the focused cell:

with thisform.Tree1.Items
	.DefaultItem = .FocusItem
	.CellFont(0,0) = thisform.Tree1.Font
	with .CellFont(0,0)
		.Name = "Comic Sans MS"
		.Bold = .t.
	endwith
endwith
thisform.Tree1.Object.Refresh()