Hola.
Aunque no es muy diferente a los códigos anteriores (generalmente es así
), otra variante:
Código Delphi
[-]
procedure TForm1.CheckListBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
begin
with Control as TCheckListBox do
begin
if Checked[Index] then
Canvas.Font.Style:= [fsStrikeOut];
FillRect(Canvas.Handle, Rect, Handle);
DrawText(Canvas.Handle, PChar(Items[Index]), -1, Rect, DT_SINGLELINE);
end;
end;
Saludos.