Coloré texte dans la même ligne dans TRichEdit
Comment écrire du texte dans la même ligne, mais avec des couleurs différentes? (j'utilise richedit).
procedure TForm1.btnEClick(sender: TObject);
begin
m0.SelAttributes.Color := clBlue;
m0.SelAttributes.Style := [fsBold];
m0.lines.add('This is blue and it is bold');
m0.SelAttributes.Color := clGreen;
m0.SelAttributes.Style := [fsBold];
m0.lines.add ('This is Green and it is bold');
m0.lines.add('');
m0.lines.add('But how to write text in the same line with different color?');
// i want to have both blue and green in the same line
end;
Meilleurs Vœux,
Abeille
OriginalL'auteur Bianca | 2013-11-25
Vous devez vous connecter pour publier un commentaire.
Vous êtes sur la bonne voie. Il suffit de changer
SelAttributes
et l'utilisationSelText
au lieu deLines.Add
:Ce produit
OriginalL'auteur Ken White