Hi, I am trying to make small game , but I am confronting with a problem. I have a function that should add a new button to my form when it's called. The problem is that I don't know how to create a new object (a button, a shape or whatever...) and adding it to my form. In Java, this would be fairly simple, but how do I it here ? my header file contains the form class:
class TForm1 : public TForm
{
__published: // IDE-managed Components
TShape *Shape1;
TButton *Button1;
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
public: // User declarations
TButton *TestBtn ;
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
At public I've added a test button (TestBtn). The same problem: how can use it ? It must be first allocated (and how)?
Thanx !