View Full Version : How to change the content of a list box dynamically?


09-12-2002, 01:29 PM
I can't find a solution!!! :o(

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

cmatthee
09-12-2002, 01:45 PM
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]

09-12-2002, 02:05 PM
It should look like this...