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
| uses
StrUtils;
const
ColorStrings : array[0..7] of string = (
'Couleur', 'Noir', 'Vert', 'Bleu', 'Rouge', 'Marron', 'Violet', 'Rose'
);
Colors : array[-1..7] of TColor = (
clRed, // default color
clBlack, clBlack, clGreen, clBlue, clRed, clMaroon, clPurple, clFuchsia
);
while not EOF(fichierTexte) do
begin
ReadLn(F, Ligne);
ReadLn(F, Ligne);
ReadLn(F, Ligne);
MainForm.TabCheck[i].Check := TCheckBox.Create(self);
with MainForm.TabCheck[i].Check do
begin
Parent := PanelTexte;
ParentColor := False;
ParentFont := False;
ParentCtl3D := False;
ParentBiDiMode := False;
Enabled := True;
Visible := True;
Left := 30;
Top := 60*I - 50;
Anchors := [akLeft, akTop, akRight];
if Length(Ligne) < 200 then
Height := 40
else
Height := 50;
WordWrap := True;
Font.Name := 'Arial';
Font.Size := 11;
Width := 1150;
OnClick := CheckBarre;
Font.Style := [fsBold];
Font.Color := Colors[AnsiIndexStr(Couleur, ColorStrings)];
Caption := Ligne;
Color := clRed;
end;
ReadLn(F, Ligne);
end; |
Partager