Réponse acceptée !
Un petit exemple pour le texte :
procedure
TForm1.FormCreate(Sender:
TObject);
begin
// definit les attributs du teste par défaut
with RichEdit1
do
begin
Lines.Clear;
DefAttributes.Color
:=
clBlue;
DefAttributes.Style
:=
[fsBold,
fsItalic];
End;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
with RichEdit1.SelAttributes do // n'est valable que pour la ligne suivante
begin
Name := 'Comic sans MS';
Color := clRed;
Height := Height + 5;
Style := [fsBold]
end;
RichEdit1.Lines.Add('Cette ligne de texte sera en rouge.');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
RichEdit1.Lines.Add('Cette ligne de texte sera en couleur par défaut.');
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
with RichEdit1 do
begin
with SelAttributes do
begin
Name := 'MS Sans Serif';
Color := clBlack;
Height := Height + 5;
Style := [fsBold]
end;
// Définit le style d'énumération à Bullet (point)
Paragraph.Numbering := nsBullet;
Lines.Add('Introduction');
Lines.Add('1° point');
Lines.Add('2° point');
Lines.Add('Suite');
Lines.Add('et fin');
Paragraph.Numbering := nsNone; // retire les Bullets
Paragraph.Alignment := taCenter; // centrer le texte
Lines.Add('');
Lines.Add('Suggestions :');
Lines.Add('');
ParaGraph.Alignment := taLeftJustify; // justifier à gauche
ParaGraph.FirstIndent := 10; // on decale de 10 vers la droite
Lines.Add('');
Lines.Add('Blablabla');
Lines.Add('et re Blablabla');
end;
end;
Pour les Images il faut utiliser un RXRichEdit
@+
Cirec