//--- IconLabel.h -------------------------------------------------------------------------------------------class PACKAGE TIconLabel : public TLayout{ private: TImage *FIcon; TLabel *FCaption; TLabel *FDescription; TFloatAnimation *FAnimation; protected: public: __fastcall TIconLabel(TComponent* Owner); __fastcall ~TIconLabel(); __published: __property TImage *Icon = {read=FIcon}; __property TLabel *Caption = {read=FCaption}; __property TLabel *Description = {read=FDescription}; __property TFloatAnimation *Animation = {read=FAnimation};}; //--- IconLabel.cpp -----------------------------------------------------------------------------------------__fastcall TIconLabel::TIconLabel(TComponent* Owner) : TLayout(Owner){ FIcon = new TImage(this); FIcon->Parent = this; FIcon->HitTest = false; FCaption = new TLabel(this); FCaption->Parent = this; FCaption->HitTest = false; FDescription = new TLabel(this); FDescription->Parent = this; FDescription->HitTest = false; FAnimation = new TFloatAnimation(this); FAnimation->Parent = this; HitTest = true;} __fastcall TIconLabel::~TIconLabel(){ FIcon->Free(); FCaption->Free(); FDescription->Free(); FAnimation->Free();}
TButton *Button = new TButton( ? ); // Вместо ? надо Application, Form1 или Panel1?Button->Parent = Panel1;