delphitcombobox

Delphi TComboBox disable highlight (focused)


After open form item in TCombobox is highlighted (Blue backgrond on text).

Is it possible disable that.

enter image description here

Tnx all!


Solution

  • You can put this message into OnEnter event of TCombobox object:

    // Suppose the combobox control name is ComboBox
    procedure TMainForm.ComboBoxEnter(Sender: TObject);
    begin
      PostMessage(ComboBox.Handle, CB_SETEDITSEL, Cardinal(-1), 0);
    end;