I'm currently trying to manipulate TShape objects over multiple classes, I had a problem with #includes and now that is sorted, the only thing i'm trying to do is create shapes on one form from another class, by creating the function and then calling it in my main class, here's my code:
void __fastcall TStackBuild::StackA(void)
{
int a = 1;
while (a > 0)
{
TShape* tokena;
tokena = new TShape(this);
tokena->Parent = frmNim->pnlA;
tokena->Shape = stRectangle;
tokena->Brush->Color = clWhite;
tokena->Width = 20;
tokena->Height = 20;
tokena->Top = 15;
tokena->Left = -10 + (22 * frmNim->pnlA->ControlCount);
a--;
}
}
and then for calling it in the main form i'm using the following:
TStackBuild* StackA();
This is nested within a button's click event.
All compiles and runs well but when the button is clicked, nothing happens, not sure where I have gone wrong. Can anyone help?