بخصوص Richedit
#2
السلام عليكم
اخي الكريم في 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; 

واستنتج ماتريد بنفسك ...
الأعمال أعلى صوتا من الكلمات
الرد


الردود في هذا الموضوع
بخصوص Richedit - بواسطة Youcef413 - 12-05-2010, 04:57 PM
بخصوص Richedit - بواسطة AvimimuS - 12-05-2010, 06:09 PM
بخصوص Richedit - بواسطة Youcef413 - 12-05-2010, 06:35 PM
بخصوص Richedit - بواسطة shagrouni - 12-05-2010, 06:55 PM
بخصوص Richedit - بواسطة Youcef413 - 12-05-2010, 07:31 PM
بخصوص Richedit - بواسطة AvimimuS - 12-05-2010, 08:14 PM
بخصوص Richedit - بواسطة Youcef413 - 12-05-2010, 08:17 PM
بخصوص Richedit - بواسطة AvimimuS - 12-05-2010, 09:31 PM
بخصوص Richedit - بواسطة Youcef413 - 13-05-2010, 11:44 AM
بخصوص Richedit - بواسطة kachwahed - 15-05-2010, 04:43 PM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم