06-10-2011, 05:32 PM
تقصد تلوين الكلمة التي نبحث عنها في كل الاسطر؟
![[صورة: 88878762.png]](http://imageshack.us/photo/my-images/510/88878762.png/)
آسف لأني لم أفهم سؤالك
لا تنسى
![[صورة: 88878762.png]](http://imageshack.us/photo/my-images/510/88878762.png/)
آسف لأني لم أفهم سؤالك
كود :
procedure GetTextColor(const ARichEdit : TRichEdit;const ASubText : AnsiString;const AColour : TColor);
var
i : Integer;
begin
if not Assigned( ARichEdit ) then
EXIT;
if ( Trim( ASubText ) = EmptyStr ) then
EXIT;
i := PosEx( ASubText, ARichEdit.Text );
while ( i>0 ) do
begin
ARichEdit.SelStart := Pred( i );
ARichEdit.SelLength := Length( ASubText );
ARichEdit.SelAttributes.Color := AColour;
ARichEdit.SelAttributes.Style :=[fsBold];
i := PosEx( ASubText, ARichEdit.Text,Succ( i ) );
end;
end;كود :
Uses StrUtiles;
