procedure TForm1.SelectColor;
var
i : integer;
Rect: TRect;
begin
with CheckListBox1 do
for i := 0 to Count-1 do
if Checked[i] = True then
begin
Canvas.Brush.Color := clRed;
Canvas.Brush.Style := bsClear;
Rect := ItemRect(i);
Rect.Left := Rect.Left+LoWord(GetSystemMetrics(SM_CYMENUCHECK));
Canvas.Rectangle(Rect);
// Canvas.TextOut(Rect.Left + font.Size, Rect.Top,Items[i])
end;
end;
간단하게 함 맹글어 본건데 참고 해 보세여....
Drawitem 과 MeasureItem 이벤트가 있는데 미처 못 해봤습니다...
procedure TForm1.SelectColor;
var
i : integer;
Rect: TRect;
begin
with CheckListBox1 do
for i := 0 to Count-1 do
if Checked[i] = True then
begin
Canvas.Brush.Color := clRed;
Canvas.Brush.Style := bsClear;
Rect := ItemRect(i);
Rect.Left := Rect.Left+LoWord(GetSystemMetrics(SM_CYMENUCHECK));
Canvas.Rectangle(Rect);
// Canvas.TextOut(Rect.Left + font.Size, Rect.Top,Items[i])
end;
end;