Revision as of 11:36, 24 June 2011 by hamishwillee (Talk | contribs)

How to change font of specific item in a listbox

From Nokia Developer Wiki
Jump to: navigation, search
Reviewer Approved    Thumbs up icon sm.jpg

Article Metadata
Tested with
Devices(s): Nokia E90
CompatibilityPlatform Security
Capabilities: )
Keywords: CEikColumnListBox, CAknColumnListBox, CColumnListBoxData, CFormattedCellListBoxData.
Created: vasant21 (18 Oct 2008)
Last edited: hamishwillee (24 Jun 2011)


This snippet shows how to change the font of specific item in a Listbox, Listbox font can be changed using CColumnListBoxData or CFormattedCellListBoxData as they handle data layout of the listbox items.

This snippet can be self-signed.


Here we assume that we already have a working code for listbox.

MMP file

The following capabilities and libraries are required:

LIBRARY avkon.lib
LIBRARY eikcoctl.lib
LIBRARY eikctl.lib

Listbox using CFormattedCellListBoxData for handling data

#include <eikfrlbd.h> 
CFormattedCellListBoxData* columnData = iListBox->ItemDrawer()->FormattedCellData();
// aIndex - index of item to be changed.
columnData->SetSubCellFontL( aIndex, LatinPlain12());

Listbox using CColumnListBoxData for handling data

#include <eikclbd.h> 
CColumnListBoxData* columnData = iListBox->ItemDrawer()->ColumnData();
// aIndex - index of item to be changed.
columnData->SetColumnFontL( aIndex, LatinBold12());


Font of the item specified with aIndex will be changed.

64 page views in the last 30 days.