Discussion Board
list box in view
2002-05-31, 14:38
#1
Super Contributor
Hi,
I am trying to display a list box in my view. The list box is displaying only one item. I tried to increase the size and attaching a scroll bar(actually I dont want a scroll bar as I have only 3 items). But nothing wokred out.
Please check the below code and let me know what's the problem?
Thanx in advance
iSelLoc = new(ELeave) CEikTextListBox;
iSelLoc->SetContainerWindowL(*this);
iSelLoc->SetObserver(this);
iSelLoc->ConstructL(this, ELbmOwnsItemArray);
iSelLoc->SetExtent(TPoint(50, 50), TSize(100,400));
CDesCArray* itemArray=new(ELeave) CDesCArrayFlat(3);
//Add items to the array.
_LIT(KItem1,"Item 1");
_LIT(KItem2,"Item 2");
_LIT(KItem3,"Item 3");
itemArray->AppendL(KItem1);
itemArray->AppendL(KItem2);
itemArray->AppendL(KItem3);
//Give the array to the list box.
iSelLoc->Model()->SetItemTextArray(itemArray);
iSelLoc->ActivateL();
iSelLoc->SetFocus(ETrue);
iSelLoc->DrawNow();
Posted by R raju, RNRAJU@yahoo.com
on February 13, 2002 at 14:56
RE: list box in view
2002-05-31, 14:39
#2
Super Contributor
Posted by R raju, RNRAJU@yahoo.com
on February 15, 2002 at 11:39
I have fixed the problem. For the benefit of others the fix is after adding items you should call HandleItemAdditionL().
Registered User
Hello,
The above piece of code does not seem to work if I am using
CAknSingleStyleListBox class instead of CEikTextListBox.
Regards,
GVR
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules