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
| procedure TfrmSuppliers.sbAddContactClick(Sender: TObject);
var
tbs : TTabSheet;
i : integer;
tblTitle: array[0..3] of string;
begin
//On s'assure que Self est un descendant de TComponent
assert(Self is TComponent, 'L''objet Self n''est pas un descendant de TComponent');
tbs := TTabSheet.Create(self);
tblTitle[0] := 'Nom :';
tblTitle[1] := 'Fonction :';
tblTitle[2] := 'Téléphone :';
tblTitle[3] := 'Mail :';
for i:= 0 to 3 do
begin
with TLabel.Create(self) do
begin
Left := 10;
Top := 8 + (i*25);
Caption := tblTitle[i];
Parent := tbs;
end;
with TDBEdit.Create(self) do
begin
Left := 90;
Top := 5 + (i*25);
Parent := tbs;
end;
end;
tbs.PageControl := pcContact;
tbs.Caption := 'n°' + intToStr(pcContact.PageCount);
end; |
Partager