The TAdvSearch* Controls have issues with VCL Styles

There are several issues with the TAdvSearch* controls and VCL Styles. The following screenshots try to illustrate the problem.

Summary:

  1. The controls do not pick up the VCL style well
  2. There is no good visible distinction between the control being enabled or disabled when VCL styles are activer
  3. The font in the edit control does not pick up the font of the form (parent). This is corrected only after you entered the control.

A TAdvSearchEdit, TAdvSearchCombobox and TAdvSearchList were placed onto a form. Vcl Styles are activated. No properties of the controls are changed in the IDE. A few strings were added to the controls in FormCreate.

Controls are enabled:
grafik

  • The buttons in the TAdvSearchEdit did not pick up the correct button color.
  • The font in the TAdvSearchEdit and TAdvSearchCombobox is too small (Segoe UI 8pt instead of 10pt).

Controls are disabled:
grafik

  • There is hardly any difference between the enabled and disabled controls apart from two tiny vertical lines at the right and left side of the edit.

Control is entered:
grafik

  • After entering the edit control, the font switches to the correct size and stays this way. I traced this one through the following steps:

In procedure TAdvCustomSearchEdit.HandleEnter(Sender: TObject);
Font.Color is assigned. This triggers a CM_FONTCHANGED message which triggers

procedure TAdvCustomSearchEdit.CMFontChanged(var Message: TMessage);
begin
  if Assigned(FEdit) and  FEdit.HandleAllocated then
  begin
    FEdit.Font.Name := Font.Name;
    FEdit.Font.Height := Font.Height;
  end;
end;

which finally sets the font's height.

Here's a screenshot of the search demo with enabled VCL styles and the form's font set to Segoe UI 10.

Please note that at design time the correct font size is used for all the "Search ..." texts, at run time it is too small.

AdvSearchEdit1 has been disabled in FormCreate. Can you spot the difference between design- and run time?
It is also a bit strange that the enabled property of the controls is not published. ;-)

Thanks for your feedback. We applied several improvements that will be included in the next release.
With respect to the item font, this is controlled by
AdvSearchEdit.Columns.Font

Thanks for taking care of it. Looking forward to the next release.

I didn't notice an issue with the dropdown item's font, but with the edit/search control's font. Just look closely at the fonts in the screenshot of your demo at design time versus run time.
Plus the AdvSearchCombobox doesn't have a Columns.Font property. So your hint doesn't help here.

Right now I'm using the current workaround in FormShow() to bring the controls into an acceptable state.

  // Work around font and color initialization bug in the AdvSearch* controls
  PostMessage(cboSearch.Handle, CM_FONTCHANGED, 0, 0);
  PostMessage(cboSearch.Handle, CM_ENABLEDCHANGED, 0, 0);```

With the improvements applied we could not longer see a difference between design-time and run-time font and we also see that handling of ParentFont = true is now correct.
These improvements will be included in the next release.