There are several issues with the TAdvSearch* controls and VCL Styles. The following screenshots try to illustrate the problem.
Summary:
- The controls do not pick up the VCL style well
- There is no good visible distinction between the control being enabled or disabled when VCL styles are activer
- 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:
- 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:
- 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:
- 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. ;-)