Hola gulder, como te dice mayanes tienes que utilizar el evento OnDrawItem del ComBoBox y su propiedad Style en csOwnerDrawFixed.
Este ejemplo te pinta el item 1 y 4, tu debes establecer tu condición.
Código Delphi
[-]
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
With ComboBox1 do
begin
if (Index=1) or (Index=4) then
begin
Canvas.Font.Name := 'Verdana';
Canvas.Font.Color := clRed;
Canvas.Font.Size := 12;
end
else
begin
Canvas.Font.Name := 'Vivian';
Canvas.Font.Color := clBlack;
Canvas.Font.Size := 10;
end;
Canvas.FillRect(Rect);
Canvas.TextOut(Rect.Left + 4, Rect.Top + 1, Items[Index]);
end;
end;
Mayanes una pregunta, si se le da un tamaño grande que pase el alto que tiene cada item, el texto se corta, ¿como se puede hacer para que el alto del item se adecue al tamaño de letra?.
Saluditos