×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Super Contributor
    Join Date
    Mar 2003
    Posts
    2,426

    list box in view

    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

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Posts
    2,426

    RE: list box in view

    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().

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    5
    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
  •  
×