Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Go Back   Foros Club Delphi > Principal > Varios
Register FAQ Members List Calendar Guía de estilo Search Today's Posts Mark Forums Read

Coloboración Paypal con ClubDelphi

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05/12/2012
ecfisa's Avatar
ecfisa ecfisa is offline
Moderador
 
Join Date: Dec 2005
Location: Tres Arroyos, Argentina
Posts: 10,508
Poder: 38
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Quote:
Originally Posted by bulc View Post
El problema es que en el Canvas del ListBox no quedan bien alineados Imagen-Texto. Las imágenes se agolpan unas sobre otras.
Hola bulc.

O estoy entendiendo mal tu problema, o la solución es ajustar la propiedad ItemHeight del ListBox a la altura de las imágenes al inicio:
Código Delphi [-]
  ListBox1.ItemHeight := ImageList1.Height;

Por ejemplo:
Código Delphi [-]
...
procedure TForm1.FormCreate(Sender: TObject);
var
  i: Integer;
begin
  with ListBox1 do
  begin
    Columns:= 1;
    Style:= lbOwnerDrawFixed;
    for i:= 0 to 9 do
      Items.Add('Item '+IntToStr(i));
    Font.Size := 24;  // tamaño font a gusto
    ItemHeight:= ImageList1.Height; // en el ejemplo: 48x48
  end;
end;

procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
begin
  with TListBox(Control) do
  begin
    Canvas.FillRect(Rect);
    ImageList1.Draw(Canvas,  Rect.Left,  Rect.Top, Index);
    Canvas.TextOut(Rect.Left + ImageList1.Width + 10,
      ((Rect.Top+Rect.Bottom)div 2)-(Font.Size div 2), Items[Index]);
  end;
end;
...
Da este resultado:



Saludos.
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Reply With Quote
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ComboBoxEx y ImageList emme_juegos OOP 15 12/02/2014 19:56
agregar y/o eliminar items de un listbox a partir de otro listbox Goyo PHP 2 27/09/2007 16:46
Gif con imagelist Ivan_25 .NET 0 24/10/2006 12:44
jpg con ImageList??? Patricio Varios 3 06/02/2006 16:51
Columns del QuickRep imprimiendo en horizontal ciscu Impresión 1 06/07/2004 15:29


All times are GMT +2. The time now is 21:37.


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