hackoustik
Messages postés81Date d'inscriptionvendredi 3 janvier 2003StatutMembreDernière intervention 8 février 2007
-
7 mars 2006 à 18:44
hackoustik
Messages postés81Date d'inscriptionvendredi 3 janvier 2003StatutMembreDernière intervention 8 février 2007
-
8 mars 2006 à 05:36
kelk1 aurait il du code dexemple pour les RichEdit, un peu de tout.
comme ca sa m'évite de poser pleins de questions ;)
par exemple, peut ton ecrire une ligne avec une couleur de fond ?
peut ont inserer un icon dans un ligne ?
Cirec
Messages postés3833Date d'inscriptionvendredi 23 juillet 2004StatutModérateurDernière intervention18 septembre 202250 8 mars 2006 à 00:32
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;