procedure TForm1.CheckListBox1DrawItem(Control: TWinControl;
Index: Integer; Rect: TRect; State: TOwnerDrawState);
var
TempColor: TColor;
begin
if odFocused in State then begin
CheckListBox1.Canvas.Brush.Color := clHighlight;
TempColor := clRed;
end else begin
CheckListBox1.Canvas.Brush.Color := CheckListBox1.Color;
TempColor := clBlack;
end;
procedure TForm1.CheckListBox1MeasureItem(Control: TWinControl;
Index: Integer; var Height: Integer);
begin
Height := 18;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
with CheckListBox1 do begin
Style := lbOwnerDrawVariable;
Items.Add('aaaaaaaa');
Items.Add('bbbbbbbb');
end;
end;