//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
GrBox[0] = GroupBox1;
GrBox[1] = GroupBox2;
GrBox[2] = GroupBox3;
GrBox[3] = GroupBox4;
GrBox[4] = GroupBox5;
GrBox[5] = GroupBox6;
GrBox[6] = GroupBox7;
GrBox[7] = GroupBox8;
GrBox[8] = GroupBox9;
GrBox[9] = GroupBox10;
Form1->DoubleBuffered = 1;
for(int i = 0; i < 10; i++)
GrBox[i]->DoubleBuffered = 1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormResize(TObject *Sender)
{
Reorder();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Reorder(void)
{
int X = 8, Y = 8;
for(int i = 0; i < 10; i++)
{
GrBox[i]->Left = X;
GrBox[i]->Top = Y;
X += GroupBox1->Width + 7;
if(X > Form1->ClientWidth - GroupBox1->Width - 8)
{
X = 8;
Y += GroupBox1->Height + 7;
}
}
}