cs_papillotte
Messages postés4Date d'inscriptionmardi 2 septembre 2003StatutMembreDernière intervention26 mai 2004
-
22 mai 2004 à 21:50
cs_papillotte
Messages postés4Date d'inscriptionmardi 2 septembre 2003StatutMembreDernière intervention26 mai 2004
-
24 mai 2004 à 17:30
Papillotte
est ce qu'il est possible de surligner du texte ? dans un RichEdit ?
Merci
cs_papillotte
Messages postés4Date d'inscriptionmardi 2 septembre 2003StatutMembreDernière intervention26 mai 2004 24 mai 2004 à 17:30
Papillotte
en faite j'ai trouvé !
uses
RichEdit;
procedure RE_SetSelBgColor(RichEdit: TRichEdit; AColor: TColor);
var
Format: CHARFORMAT2;
begin
FillChar(Format, SizeOf(Format), 0);
with Format do
begin
cbSize := SizeOf(Format);
dwMask := CFM_BACKCOLOR;
crBackColor := AColor;
Richedit.Perform(EM_SETCHARFORMAT, SCF_SELECTION, Longint(@Format));
end;
end;
// Example: Set clYellow background color for the selected text.
procedure TForm1.Button1Click(Sender: TObject);
begin
RE_SetSelBgColor(RichEdit1, clYellow);
end;