Hi,
yeah its me again, i know this sucks but please help
i want to add a button programmatically to my view. i do this for example in the HandleCommandL() method is with this code:
The problem is that the button is not displayed after this code is executed (note theres not panic code so the code should be ok from my perspective). Can anyone please tell me why the button is not displayed? I'm pretty sure i forgot something.Code://ETestButtonCtrl is a button that is defined in the resource file CEikTextButton* button = LocateControlByUniqueHandle<CEikTextButton>(ETestButtonCtrl); //now i want to add a button to the parent of ETestButtonCtrl MCoeLayoutManager* l = button->LayoutManager(); //i create my button and add it to container control CEikTextButton* b = new CEikTextButton(); this->AddControlLC(b,ETestButtonCtrl2); l->AttachL(*b); //set needed stuff and format b->SetUniqueHandle(ETestButtonCtrl2); _LIT(buttonText,"Click My Button"); b->SetTextL(buttonText,CEikTextButton::EFirst); b->SetPosition(TPoint(50,50)); b->SetSize(TSize(100,30)); b->SetParent(button->Parent()); b->MakeVisible(ETrue); b->SetContainerWindowL(*button->Parent()); //now draw it b->DrawNow();
Thx in advance for helping.



