Вниз
Скачать: CL | DM;

Отрисовка ellipce в ListBox   Найти похожие ветки 

← →
Scot Storch   (2008-11-18 12:51) [0]

Необходимо для каждого 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;

Помогите исправить


← →
MBo ©   (2008-11-18 13:06) [1]

после рисования эллипса Brush.style поставь bsClear


← →
{RASkov} ©   (2008-11-18 13:07) [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;


← →
Scot Storch   (2008-11-18 13:14) [3]

Всем спасибо



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.007 c
2-1226816784
aNtId
2008-11-16 09:26
2008.12.28
работа с реестром


15-1224873194
Andy BitOff
2008-10-24 22:33
2008.12.28
MS Access или не MS Access, вот в чем вопрос.


15-1223781352
Riply
2008-10-12 07:15
2008.12.28
Тем, кому я не смогла ответить.


2-1226578957
misha_shar
2008-11-13 15:22
2008.12.28
Cobitia


15-1225078082
Slider007
2008-10-27 06:28
2008.12.28
С днем рождения ! 25 октября 2008 суббота




   Наверх