![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Компонент [D6, D7, WinXP]
Ivolg © (2005-01-16 12:48:00)Всем привет!! Подскажите пожайлусто компонент типа Memo или RichEdit'a ,только чтобы у каждой строчки текста можно было менять цвет!!! СПАСИБО!!!!
Ivolg (2005-01-17 14:22:00) [1]Спасибо!
remb (2005-01-16 17:15:00) [2]asvt (21.12.04 13:03) [2]
Procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
with TListBox(Control).Canvas do begin
if odSelected In State then begin
Brush.Color := clBlack;// Выделение черным
Font.Color := clWhite;
end
else
case index mod 4 of //четыре строки с чередованием
0: begin
Brush.Color := clRed;
Font.Color := clWhite;
end;
1: begin
Brush.Color := clAqua;
Font.Color := clBlack;
end;
2: begin
Brush.Color := clYellow;
Font.Color := clBlack;
end;
3: begin
Brush.Color := clLime;
Font.Color := clBlack;
end;
end; { Case }
FillRect(Rect);
TextOut(Rect.Left +2, Rect.Top, TListBox(Control).Items[Index]);
If odFocused In State Then Begin
InflateRect(Rect, -1, -1);
DrawFocusRect(Rect);
End;
End;
end;
procedure TForm1.ListBox1MeasureItem(Control: TWinControl; Index: Integer;
var Height: Integer);
begin
Height := (Control As TListbox).ItemHeight + 2;
end;
Ivolg (2005-01-16 17:09:00) [3]Капец!!! чё не кто незнат! Помню сто раз натыкался на подобный вопрос в форуме, ну тогда он был мне не к чему!!
Fay (2005-01-16 13:03:00) [4]Ivolg (16.01.05 12:48)
Тогда уж пайжойлуйсто8)