Bonjour,
Je crée dynamiquement (quand la fenêtre Form1 est activé) un TTabbedNotebook qui ce nomme TNB_principal puis a l'aide d'un bouton je crée un TTabbedNotebook parent au précédent (dans le code je fais appelle à une form2 elle me sert a renommer les onglets directement) pour créée dynamiquement chaque TTabbedNotebook enfant (un dans chaque onglet de TNB_principal) j'ai créé un tableau de TTabbedNotebook.

Je ne comprend pas pour moi tout parait bon et pourtant quand je crée le TNB_principal tout fonction mais des que je lance les TTabbedNotebook enfant (du tableau) j'ai un bug
(Voir image si dessous) :



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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
 
  private
    procedure Ajout_init_etage();
    procedure Ajout_init_piece();
        { Private declarations }
  public
 
    { Public declarations }
  end;
 
var
  Form1: TForm1;
  Variable_form1: String ;
  TabPage : TTabPage;
  TNB_principal1: Array Of TTabbedNotebook ;
  TNB_principal : TTabbedNotebook ;
  Nb_liste: Integer ;
implementation
 uses unit2;
{$R *.dfm}
 
 
 ///////////////////////////////////////////////////////////
                         { Functions de création }
 ///////////////////////////////////////////////////////////
 
 
procedure TForm1.Ajout_init_etage();
  begin
              if Form2.ShowModal = mrOk then
                begin
                  TNB_principal := TTabbedNotebook.Create(Self);
                  TNB_principal.Parent := Form1 ;
                  TNB_principal.Pages[0] := Variable_form1;
                  TNB_principal.Top := 32 ;
                  TNB_principal.Height := 489 ;
                  TNB_principal.Width := 825 ;
                end;
   end;
 
 
 
procedure TForm1.Ajout_init_piece();
  begin
    Nb_liste := TNB_principal.PageIndex ;
    SetLength(TNB_principal1,Nb_liste);
 
 
              if Form2.ShowModal = mrOk then
                begin
                   TNB_principal1[Nb_liste] := TTabbedNotebook.Create(Self);
                   //TNB_principal_[PageIndex].Parent := TNB_principal ;
                   //TNB_principal_[PageIndex].Pages[0] := Variable_form1;
                   //TNB_principal_[PageIndex].Height := 450 ;
                   //TNB_principal_[PageIndex].Width := 800 ;
          end;
 
   end;
 
 ///////////////////////////////////////////////////////////
                         { Evenements }
 ///////////////////////////////////////////////////////////
 
 
 
procedure TForm1.FormActivate(Sender: TObject);
  begin
    Ajout_init_etage();
  end;
 
 
procedure TForm1.Button1Click(Sender: TObject);
  begin
   Ajout_init_piece();
  end;
 
end;

Merci d'avance pour votre aide