Ver Mensaje Individual
  #4  
Antiguo 15-03-2013
[maeyanes] maeyanes is offline
Capo de los Capos
 
Registrado: may 2003
Ubicación: Campeche, México
Posts: 2.732
Reputación: 24
maeyanes Va por buen camino
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...
__________________
Lee la Guía de Estilo antes que cualquier cosa. - Twitter

Última edición por maeyanes fecha: 15-03-2013 a las 17:52:19.
Responder Con Cita