在 Delphi 10.1 Berlin VCL 应用程序中,在外观页面上的项目选项中,我为默认的Windows样式添加了两种样式:
在FormShow
事件处理程序中,我有以下代码:
procedure TForm1.FormShow(Sender: TObject);
var
s: string;
begin
// Show all available in application styles:
ComboBox1.Items.BeginUpdate;
try
ComboBox1.Items.Clear;
for s in TStyleManager.StyleNames do
ComboBox1.Items.Add(s);
ComboBox1.Sorted := True;
ComboBox1.ItemIndex := ComboBox1.Items.IndexOf(TStyleManager.ActiveStyle.Name);
finally
ComboBox1.Items.EndUpdate;
end;
end;
但不幸的是,在运行时,组合框仅包含一项:默认的 Windows 样式:
那么如何才能在项目选项中检查所有样式?