FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
||||
|
||||
ImageList en ListBox.Columns:=1
Hola. Estoy intentando colocar una imagen (de un ImageList) a la izquierda del texto de un ListBox. El ListBox se mueve en horizontal para lo que asigno 1 a la prop. Columns. El problema es que en el Canvas del ListBox no quedan bien alineados Imagen-Texto. Las imágenes se agolpan unas sobre otras. Aunque de las cinco que tengo la primera, "casi" queda bien. Me gustaría cargar
unas treinta imágenes de unos 60x40 píxeles para que aparezca una secuencia de imagen+ palabra en cada clic de ratón sobre las flechas del ListBox. Sigo este código pero un poco a ciegas porque no entiendo bien el proceso. A ver si algún apóstol de Delphi me ilumina. Gracias Última edición por bulc fecha: 04-12-2012 a las 19:48:55. |
#2
|
||||
|
||||
bulc,
Revisa esta imagen: Revisa este código: El código anterior implementa los componentes freeware TImgComboBox y TImgListBox creados por Derek van Daal : derekvandaal@hotmail.com El ejemplo y el componente se encuentran en el link: http://terawiki.clubdelphi.com/Delph...ImgListBox.rar La información original fue obtenida del link: http://www.delphipages.com/comp/imag...ist_-4580.html Espero sea útil Nelson. Última edición por nlsgarcia fecha: 04-12-2012 a las 21:58:42. |
#3
|
||||
|
||||
bulc,
Component Information: Cita:
Nelson. Última edición por nlsgarcia fecha: 05-12-2012 a las 00:09:15. |
#4
|
||||
|
||||
Cita:
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:
Por ejemplo: Da este resultado: Saludos.
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... |
#5
|
||||
|
||||
Me lo estudio
No sé como sabéis tanto. Gracias.
|
#6
|
||||
|
||||
Canvas.TextOut
Cita:
|
#7
|
||||
|
||||
Hola bulc.
Hice ese cácluculo para centrar verticalmente el texto de forma aproximada. La mitad del alto es Rect.Top+Rect.Bottom div 2 y ya que están igualados, también se podría haber usado ImageList1.Height div 2. Código:
+----------+ Top | | |----------| Top+Bottom / 2 | | +----------+ Button
Saludos.
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... |
#8
|
||||
|
||||
bulc,
La solución de Ecfisa es excelente, sin embargo te sugiero revisar los componentes TImgComboBox y TImgListBox creados por Derek van Daal dado que facilitan el uso de imágenes y permiten la creación de un código más simple y directo. Espero sea útil Nelson. |
#9
|
||||
|
||||
Gracia a ambos. Voy a colocarlo en mi aplicación a ver qué tal.... Hasta pronto.
|
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
ComboBoxEx y ImageList | emme_juegos | OOP | 15 | 12-02-2014 19:56:40 |
agregar y/o eliminar items de un listbox a partir de otro listbox | Goyo | PHP | 2 | 27-09-2007 16:46:30 |
Gif con imagelist | Ivan_25 | .NET | 0 | 24-10-2006 12:44:44 |
jpg con ImageList??? | Patricio | Varios | 3 | 06-02-2006 16:51:27 |
Columns del QuickRep imprimiendo en horizontal | ciscu | Impresión | 1 | 06-07-2004 15:29:08 |
|