Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros temas > Trucos
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Los mejores trucos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 30-06-2006
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Poder: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Pintar en un TListBox o TCheckListBox

Ejemplo sobre el TCheckListBox, ya que creo que es mas complejo y se puede aplicar al TListBox con una pequeña modificacion poniendo la propiedad Style en lbOwnerDrawFixed y creando el siguiente Evento

Código Delphi [-]
procedure TForm1.CheckListBox1DrawItem(Control: TWinControl;
Index: Integer; Rect: TRect; State: TOwnerDrawState);
var
  ABitmap: TBitmap;
begin

  ABitmap := TBitmap.Create;
  try
    ImageList1.GetBitmap( Index, ABitmap );
  finally
    CheckListBox1.Canvas.FillRect(Rect);
    CheckListBox1.Canvas.Draw( 15, Rect.Top, ABitmap );
    CheckListBox1.Canvas.TextOut( ABitmap.Width+20, Rect.Top
    +( ( Rect.Bottom-Rect.Top
    -CheckListBox1.Canvas.TextHeight( CheckListBox1.Items[ Index ] ) ) div 2 )
    , CheckListBox1.Items[ Index ] );
  end;

end;
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 00:43:52.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi