![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#2
|
||||
|
||||
|
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;
__________________
delphi.com.ar Dedique el tiempo suficiente para formular su pregunta si pretende que alguien dedique su tiempo en contestarla.
|
|
|
|