Ver Mensaje Individual
  #2  
Antiguo 03-01-2005
Avatar de JavierB
JavierB JavierB is offline
Miembro
 
Registrado: may 2003
Ubicación: Madrid
Posts: 99
Reputación: 22
JavierB Va por buen camino
Hola Tecnic2

Pon la propiedad Style del ListBox a lbOwnerDrawFixed y en el evento OnDrawItem pones este código:
Código Delphi [-]
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
begin
  InflateRect(Rect,-5,0);
  with ListBox1 do
    DrawText(Canvas.Handle,PChar(Items[Index]),-1,Rect,DT_RIGHT);
end;

La línea InflateRect(Rect,-5,0); es para que no quede demasiado pegado a la derecha. Cambia el -5 por el valor que prefieras.

Saludos,
__________________
Lo importante no es saber, sino tener el e-mail del que sabe.
Responder Con Cita