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

How to change the content of a list box dynamically?

2 replies · 2,976 views · Started 09 December 2002

I can't find a solution!!! 😮(

I just want to add a new entry into my CAknDoubleNumberStyleListBox...

But all I found out till now is how to create a new entry (and overwrite everything)... But I need to add a new entry after the existing entries...

How can I do that? Didnt find any help in the SDK...

Thank you guys...

Wumms

I don't know a CAknDoubleNumberStyleListBox. The following will work for any listbox that uses the CTextListBoxModel as model.

[code:1]CTextListBoxModel* lbModel = (CTextListBoxModel*)iLbox->Model();
CDesCArray* textarray = (CDesCArray*)lbModel->ItemTextArray();
textarray->InsertL(pos, newtext);
iLbox->HandleItemAdditionL();
iLbox->UpdateScrollBarsL();
iLbox->DrawDeferred();[/code:1]