Ver Mensaje Individual
  #2  
Antiguo 22-10-2003
Avatar de delphi.com.ar
delphi.com.ar delphi.com.ar is offline
Federico Firenze
 
Registrado: may 2003
Ubicación: Buenos Aires, Argentina *
Posts: 5.964
Reputación: 29
delphi.com.ar Va camino a la fama
Aquí te paso un ejemplo sencillo:
Código:
{
  www.delphi.com.ar
  El combo debe tener la propiedad Style en uno de los siguientes valores: csOwnerDrawFixed, csOwnerDrawVariable
}
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
begin
  with ComboBox1.Canvas do
  begin
    if not (odSelected in State) Then
    begin
      if Odd(Index) Then
        Font.Color := clWhite
      else
        Font.Color := clBlack;

      if Odd(Index) Then
        Brush.Color := clGray
      else
        Brush.Color := clSilver;
    end;

    FillRect(Rect);
    TextRect(Rect, Rect.Left + 1, Rect.Top + 1, ComboBox1.Items[Index]);
  end;
end;
Saludos!
__________________
delphi.com.ar

Dedique el tiempo suficiente para formular su pregunta si pretende que alguien dedique su tiempo en contestarla.
Responder Con Cita