How to disable events when runtime Delphi VCL Style changes
<p>I want to use VCL Style's in my application.
I have some code in events OnShow, OnResize...</p>

<p>When changing styles triggered other form events.(FormShow, FormResize)</p>

<p>How to disable events when on change style.</p>

<p>For change style i use code:</p>

<pre><code>TStyleManager.TrySetStyle(cbStyles.Items[cbStyles.ItemIndex], True);
</code></pre>

<p>Sample Code:</p>

<pre><code>procedure TForm1.AddLog(AMsg: String);
begin
  if cbEnableLog.Checked
  then  Memo1.Lines.Append(AMsg);
end;

procedure TForm1.bChangeClick(Sender: TObject);
begin
  TStyleManager.TrySetStyle(cbStyles.Items[cbStyles.ItemIndex],True);
end;

procedure TForm1.FormResize(Sender: TObject);
begin
  AddLog('FormResize');
end;

procedure TForm1.FormShow(Sender: TObject);
begin
  AddLog('FormShow');
end;
</code></pre>

<p><a href="https://i.stack.imgur.com/QeKxH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QeKxH.png" alt="Called events."></a></p>