Ik heb het gevonden. De ownerdrawitem wordt alleen aangeroepen als de style van de combobox csOwnerdrawvariable of csOwnerdrawfixed is.
Hier is de code om de kleur van je selector te veranderen
Code:
procedure Tmainform.drawcombo(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
var txt:string;
begin
inherited;
if Control is TComboBox then
begin
with TComboBox(Control) do
begin
if (odselected in state)or (odfocused in state) then
begin
Canvas.brush.Style := bsSolid;
Canvas.brush.color := $00DCCFC7;
Canvas.FillRect(Rect);
Canvas.font.Color:=clblack;
txt:=Items.Strings[index];
Canvas.TextOut(rect.left+2,rect.Top,txt);
end
else
begin
Canvas.brush.Style := bsSolid;
Canvas.brush.color := color;
Canvas.FillRect(Rect);
Canvas.font.Color:=clblack;
txt:=Items.Strings[index];
Canvas.TextOut(rect.left+2,rect.Top,txt);
end;
end;
end;
end;
Bookmarks