Read-only archive of the All About Symbian forum (2001–2013) · About this archive

How to clear listbox?

1 replies · 6,317 views · Started 19 December 2002

You must clear the contents of the listbox model before calling iListBox->Reset().

The following code are from memory (so there may be errors) and is for a text listbox.

[code:1]CTextListBoxModel* lbModel = (CTextListBoxModel*)iListBox->Model();
CDesCArray* textarray = (CDesCArray*)lbModel->ItemTextArray();
textarray->Reset();
iListBox->Reset(); // or iListbox->HandleItemRemoval();
[/code:1]