12-05-2010, 06:09 PM
السلام عليكم
اخي الكريم في RichEdit توجد الخاصية SelAttributes والتي تسمح لنا بتحكم في خصائص النص
المدرج
فمثلا لتغير حجم النص يكفي كتابة
او لتغير اللون نو ع النص
والمثال الاتي يوضح طريقة التعامل مع النص في [COLOR="Red"]RichEdit[/COLOR]
واستنتج ماتريد بنفسك ...
اخي الكريم في RichEdit توجد الخاصية SelAttributes والتي تسمح لنا بتحكم في خصائص النص
المدرج
فمثلا لتغير حجم النص يكفي كتابة
PHP كود :
SelAttributes.Size := 15;
PHP كود :
SelAttributes.Color := clRed;
PHP كود :
SelAttributes.Style := [fsBold];//(fsBold, fsItalic, fsUnderline, fsStrikeOut)
والمثال الاتي يوضح طريقة التعامل مع النص في [COLOR="Red"]RichEdit[/COLOR]
PHP كود :
with MyRichEdit do
begin
//move caret to end
SelStart := GetTextLen;
//add one unformatted line
SelText := 'This is the first line' + #13#10;
//add some normal font text
SelText := 'Formatted lines in RichEdit' + #13#10;
//bigger text
SelAttributes.Size := 15;
//add bold + red
SelAttributes.Style := [fsBold];
SelAttributes.Color := clRed;
SelText := 'Delphi';
//only bold
SelAttributes.Color := clWindowText;
SelText := ' 4Arab';
//add italic + blue
SelAttributes.Style := [fsItalic];
SelAttributes.Color := clBlue;
SelText := 'Programming';
//new line
SelText := #13#10;
//add normal again
SelAttributes.Size := 8;
SelAttributes.Color := clGreen;
SelText := 'think of AddFormattedLine custom procedure...';
end;
واستنتج ماتريد بنفسك ...
الأعمال أعلى صوتا من الكلمات

