TShape zur Laufzeit erstellen
-
Hallo!
Habe mal wieder ein Problem!

Ich möchte nach jedem Click auf einen Button ein TShape erstellen.
Nun dachte ich mir, ich nehme dafür am Besten ein Array welches ich zur Laufzeit erstelle. Ich habe im FAQ auch etwas gefunden, allerdings erstellt er mir keine TShapes sondern irgendeine Box!
Weiss jemand was ich falsch mache!DynamicArray<TShape*>LblArray; int LblNum = 10;__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { LblArray.Length = LblNum; for (int i = 0; i < LblArray.Length; i++) { LblArray[i] = new TShape(this); }void __fastcall TForm1::Bspieler1Click(TObject *Sender) { for (int i = 0; i < LblArray.Length; i++) { LblArray[i]->Parent = this; //LblArray[i]->Caption = "Shape" + String(i+1); LblArray[i]->Top = 20 * i; LblArray[i]->Show(); }DANKE schon mal!
Gruß Eleonora
-
Eleonora schrieb:
allerdings erstellt er mir keine TShapes sondern irgendeine Box!
Beim erzeugen eines TShape ist doch Standardsmäßig Shape=stRectangle;
also eine Box, wenn du keine Box haben willst dann mach halt keine!LblArray[i]->Parent = this; LblArray[i]->Shape = stCircle; //ich will z.B. Kreise LblArray[i]->Top = 20 * i; LblArray[i]->Show();
-
Super, danke!

Gruß