我需要一个表格来测试样式。并且仅以这种形式应用每种样式。但是 TStyleManager.SetStyle 适用于应用程序中的所有表单。如何仅以当前形式应用样式?
procedure TForm1.FormCreate(Sender: TObject);
var styleName: String;
begin
ListBox1.Items.Clear;
for styleName in TStyleManager.StyleNames do
ListBox1.Items.Add(styleName);
end;
.......
procedure TForm1.ListBox1Click(Sender: TObject);
begin // this applies to all forms in application, I want apply only this form!
TStyleManager.SetStyle(ListBox1.Items[ListBox1.ItemIndex]);
end;