Hola...
También puedes usar la propiedad
Style con el valor
fsStrikeOut de la clase
TFont y el evento
OnDrawItem:
Código Delphi
[-]
procedure TForm1.CheckListBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState
var
ItemStz: array [0..255] of Char;
begin
with CheckListBox1.Canvas do
begin
Font.Assign(Self.Font);
Brush.Color := CheckListBox1.Color;
if CheckListBox1.Checked[Index] then
Font.Style := [fsStrikeOut]
else
Font.Style := [];
StrPCopy(ItemStz, CheckListBox1.Items[Index]);
DrawText(Handle, ItemStz, -1, Rect, DT_WORDBREAK or DT_EXPANDTABS)
end
end;
Tienes que poner la propiedad
Style del componente en
lbOwnerDrawFixed. También, como comenta
Neftalí, hay que pulir algunas cosas.
Saludos...
P.D. Vaya, tuve la misma idea que
Chris...