Możesz też z poziomu kodu, m. in. np. tak:
Image1->BringToFront();
Image1->SendToBack();
// Aby ustawić dokładny indeks kontrolki w hierarchii kontrolek Form-y,
// można manipulować tablicą Controls
TControl *control = Form1->Controls[0]; // Przykład pobrania kontrolki o indeksie 0
Form1->RemoveControl(control); // Usunięcie kontrolki
Form1->InsertControl(control, 2); // Dodanie kontrolki na indeksie 2
// Ewentualnie później po ustaleniu zIndex-u
Image1->Left = 100;
Image1->Top = 100;
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
// Podłącz zdarzenie OnCreate
this->OnCreate = FormCreate;
}
void __fastcall TForm1::FormCreate(TObject *Sender)
{
// Ustawienie indeksu kontrolki Image1 podczas ładowania Form-y
SetControlZIndex(Image1, 2);
}
void __fastcall TForm1::SetControlZIndex(TControl *control, int index)
{
if (control->Parent == this && index >= 0 && index < this->ControlCount)
{
this->RemoveControl(control);
this->InsertControl(control, index);
}
}
BTW, polecam: