Ver Mensaje Individual
  #2  
Antiguo 14-01-2010
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - Espańa
Posts: 18.275
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Utiliza el evento OnDrawItem del ComboBox.

(1) Coloca en un formulario un TComboBox y rellena unos cuentos elementos.
(2) Propiedad Style a OwnerDrawFixed (MUY IMPORTANTE)
(3) Coloca un LAbel en el formulario.
(4) En el evento OnDrawFixed lo siguiente:

Código Delphi [-]
  with Control as TComboBox do
   begin
     // Rectagulo
     Canvas.FillRect(Rect);
     //Texto
     Canvas.TextOut(Rect.Left, Rect.Top, ComboBox1.Items[Index])
   end;

  if (odSelected in State)  then begin
    Label2.Caption := 'Seleccionando el ' + IntToStr(Index) + '   - ' + ComboBox1.Items[Index];
  end;

Un saludo.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita