Board index » cppbuilder » How to create a TTreeView dynamically?
cylin
![]() CBuilder Developer |
How to create a TTreeView dynamically?2003-08-27 05:05:02 PM cppbuilder62 Dear all, Here is part of my codes. ---------------------------------------------------------------------- void __fastcall TForm1::FormCreate(TObject *Sender) { TTreeView *TV=new TTreeView(Application); TV->Width=200; TV->Height=100; TV->Top=0; TV->Left=0; // TV->Color=clGreen; // TV->Items->AddChild(NULL,"test"); TV->Visible=true; } ---------------------------------------------------------------------- When I press run, I can't see a TreeView in this form. if I add TV->Color=clGreen; or TV->Items->AddChild(NULL,"test");, I'll appear a exception, class EInvalidOperation with message Control "has no parent window". How to solve it? or How to create a TreeView correctly? Thanks for your answer. Regards, cylin. |