delphi4arab منتديات دلفي للعرب

نسخة كاملة : كيف أجعل Memo متعدد الوان
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم ورحمة الله وبركاته

كيف اجعل محتوى Memo متعدد الوان بحيث يكون لونين يعني عند كل متغير يصبح لون أخضر
يعني هكذا
كود :
http://www.supershareware.com/images/screenshot/DzSoft_PHP_Editor-11721.gif
طيب أخي مشكور وما قصرت أحلى تقيم
لأكن كيف أغير لون كلمة معينه لأني لم أقدر عملها ولم افهم الشرح
مثال:
PHP كود :
Author: Thomas Stutz 

{
  
To color text in a TRichEdit, follow this two steps:
  
1) Select the text with the SelStart, SelLength properties.
  
2) Set the text attribtutes through the SelAttributes property.

  
1.Example:
  
Add a colored line to a TRichEdit:
}

procedure AddColoredLine(ARichEdit: TRichEdit; AText: string; AColor: TColor);
begin
  with ARichEdit 
do
  
begin
    SelStart 
:= Length(Text);
    
SelAttributes.Color := AColor;
    
SelAttributes.Size := 8;
    
SelAttributes.Name := 'MS Sans Serif';
    
Lines.Add(AText);
  
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  AddColoredLine
(RichEdit1, 'Hallo', clRed);
  
AddColoredLine(RichEdit1, 'Hallo', clGreen);
end;

{
  
2. Example:
  
To color the 5 characters.
}


procedure TForm1.Button1Click(Sender: TObject);
begin
  RichEdit1
.SelStart  := 0;
  
RichEdit1.SelLength := 5;
  
RichEdit1.SelAttributes.Color := clBlue;
end;

{
  
3. Example: ( by www.delphimania.de)
  
To color a specified line with a color:
}

procedure RE_ColorLine(ARichEdit: TRichEdit; ARow: Integer; AColor: TColor);
begin
  with ARichEdit 
do
  
begin
    SelStart 
:= SendMessage(Handle, EM_LINEINDEX, ARow - 1, 0);
    
SelLength := Length(Lines[ARow - 1]);
    
SelAttributes.Color := AColor;
    
SelLength := 0;
  
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ZeileFaerben
(RichEdit1, 4, clGreen);
end; 
المثال يتطلب حد أدنى من المعرفة بالتعامل مع مكونات ولغة دلفي
مرحبا بك في دلفي للعرب
http://www.delphi4arab.net/forum/showthr...p?tid=5180
بالتوفيق.