Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   componentes combobox con icono (https://www.clubdelphi.com/foros/showthread.php?t=23140)

locango 07-07-2005 18:31:43

componentes combobox con icono
 
alguien me puede ayudar como igreso un icono a un combobox adelante de la opcion o me pueden decir otro componente que haga eso pero que su forma sea como el combobox gracias

jachguate 07-07-2005 19:06:07

Podes hacerlo en un combobox normal, poniendo su propiedad Style a csOwnerDrawFixed o csOwnerDrawVariable (dependiendo de si la altura de los items es variable o no), y luego escribiendo el evento OnDrawItem.

La misma ayuda de delphi dice:

Cita:

Empezado por F1
Write an OnDrawItem event handler to draw the items in the drop-down list of an owner-draw combo box. An OnDrawItem event handler can add graphic elements to the list items, or replace the list item text by graphics.

Draw the items on the Canvas using the coordinates provided by the Rect parameter. OnDrawItem occurs only if Style is set to csOwnerDrawFixed or csOwnerDrawVariable.

If an OnDrawItem event handler is not provided, the combo box fills the Rect parameter with the current brush and writes the text value of the item specified by the Index parameter.

Hasta luego.

;)

roman 07-07-2005 19:17:03

Ahora que, si usa D >= 6 bastaría usar un ComboBoxEx (paleta Win32)

// Saludos

locango 11-07-2005 17:18:35

ComboBoxEx
 
gracias por responder
y con el en que propiedad del ComboBoxEx puedo agregar iconos

roman 11-07-2005 17:32:19

Los iconos los colocas en un TImageList y asignas éste a la propiedad Images del ComboBoxEx.

Agregas los items del combo con la propiedad ItemsEx y a cada item le asignas el índice (ImageIndex) del icono que quieres usar.

// Saludos

locango 11-07-2005 22:18:09

ComboBoxEx tiempo de ejecion
 
una pregunta mas comopuedo hacer que en tiempo de ejecucion ingresen al ComboBoxEx todas los string que ingrese en el comboboxex que se vayan llenando y que solo muestre ocho y los demas con una lecha abajo


La franja horaria es GMT +2. Ahora son las 12:29:32.

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