![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Отрисовка ellipce в ListBox
Scot Storch © (2008-11-18 12:51:00)Необходимо для каждого item'a ListBox'а слева от текста нарисовать круг закрашеный определенным цветом.
Делаю так, но закрашивается вся область с текстом:
procedure Tform_Main.list_ResultDrawItem(ListBox: TCustomListBox_;
Canvas: TCanvas; Index: Integer; var Rect: TRect; State: TOwnerDrawState;
var Done: Boolean);
begin
with Rect do
begin
Canvas.Brush.Color := TColor(ListBox.Items.Objects[Index]);
Canvas.Ellipse(Left + 4, Top + 4, Left + 12, Bottom - 4);
Inc(Left, 16);
end;
end;
Помогите исправить
Scot Storch (2008-11-18 13:14:00) [1]Всем спасибо
{RASkov} (2008-11-18 13:07:00) [2]> [0] Scot Storch (18.11.08 12:51)
procedure Tform_Main.list_ResultDrawItem(ListBox: TCustomListBox_;
Canvas: TCanvas; Index: Integer; var Rect: TRect; State: TOwnerDrawState;
var Done: Boolean);
begin
with (Control as TListBox).Canvas do
begin
FillRect(Rect);
TextOut(Rect.Left+16, Rect.Top, (Control as TListBox).Items[Index]);
Brush.Color := TColor(ListBox1.Items.Objects[Index]);
Ellipse(Rect.Left + 4, Rect.Top + 4, Rect.Left + 12, Rect.Bottom - 4);
//Inc(Left, 16);
end;
end;
MBo (2008-11-18 13:06:00) [3]после рисования эллипса Brush.style поставь bsClear