Redimensionnement composants après modif taille fenetre
Bonjour,
j'ai une appli que je veux pouvoir agrandir en plein écran mais je ne sais pas si je gère bien le redimensionnement des composants de ma fiche.
Il y a surement un moyen plus simple pour gérer la mise en page après changement de la taille de la fenêtre.
Merci de m'éclairer là-dessus.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| void __fastcall TForm1::FormResize(TObject *Sender)
{
// Redimensionnement des Memo
Memo1->Left = 8;
Memo2->Left = 8;
Memo1->Width = Form1->Width - 24;
Memo2->Width = Form1->Width - 24;
if (Memo1->Width < 610) // Taille d'origine
{
Memo1->Height = 81;
Memo2->Height = 81;
Memo1->Top = 184;
Memo2->Top = 288;
Label8->Top = 272;
}
else // Adaptation des tailles pour le plein écran
{
Memo1->Height = 162;
Memo2->Height = 162;
Memo2->Top = Memo2->Top + 81;
Label8->Top = Label8->Top + 81;
}
// Redimensionnement des TCapture
TCapture->Left = 8;
TCapture->Width = Form1->Width - 24;
TCapture2->Left = 8;
TCapture2->Width = Form1->Width - 24;
} |