ColorBox.Selected := clNone; <= works correctly, None is selected
ColorBox.Selected := clNone; <= bug: "Custom..." is selected
This happens because the first time color object will be set here:
Code:
procedure TsCustomColorBox.SetSelected(const AColor: TColor);
var
I, J: Integer;
begin
if HandleAllocated then begin
I := Items.IndexOfObject(TObject(AColor));
if AColor <> 0 then begin
if ((cbCustomColor in Style) or (PopupMode = pmPickColor)) and ((AColor <> NoColorSelected) or UseAlpha) then
TComboBoxExStrings(Items).ItemsEx[0].Data := TObject(AColor);
…
const
NoColorSelected = TColor($FF000000);
I changed the NoColorSelected const to clNone to fix this for now.