Bonjour à tous,
J'ai un problème avec l'imbrication de composants créés dynamiquement.
Je suis dans dans une boucle, dans laquelle je crée des composants.
Par exemple: dans cette boucle, je crée un "Tpanel" dynamiquement et dans ce Panel je veux créer un bouton dynamiquement.
Je ne sais plus, tout simplement, comment indiquer au bouton qui est son "Parent" => le Tpanel.
En plus cela doit pas ... , mais je trouve pas !
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 for i :=1 to Nombre do begin if (uppercase(ParametreMesure[indice].ParamHC[I])='B') then begin TPanel.Create(Self).Name :='P' +IntToStr(i); with TPanel(FindComponent('P' +IntToStr(i)))do begin Parent:=ScrollBox1; Align:=alleft; Top :=(i * 22)-20; Height:=22; Width:=80; blablabla... TAdvComboBox.Create(Self).Name :='PC' +IntToStr(i); with TAdvComboBox(FindComponent('PC' +IntToStr(i)))do begin Parent:= ; <== mon probleme est ici. top:=0; align:=alleft; Width:=40; blablabla... end; end; end; end; end;
Merci à tous !
Partager