TAdvPanel and TAdvFormStyler

I need a piece of advice regarding AdvPanel styles.
I have an application where I intensively use TAdvPanel component with custom setting to caption and status bar. I would like to use latest VCL UI Pack, but the new version if AdvPanel "strongly" cooperates with AdvFormStyler (which I use for styling AdvGlowButtons) and AdvPanel also gets styled.
Is there a chance to 'remove' this cooperation, I don't want my panels styled along with styler settings.
And yes, I have UIStyle set to tsCustoms (although this property value is not stored in dfm file).

Any clues?


This is indeed something that has changed as the TAdvPanel now has the TMS style interface.
But this was actually a shortcoming as it is meant for the TAdvFormStyler to change all of the components on the form.
Setting the UIStyle to tsCustom will not have any effect, as the TAdvFormStyler forces his style on all of the components. The UIStyle property is used to easily set individual components to the style of your liking.
The reason that tsCustom is not stored in your dfm, is because this is the default value.

Perhaps it might be feasible to set all of the styles of the components when creating the form or changing the style?
This can for example be done with the following code:


procedure TForm2.FormCreate(Sender: TObject);
  tmsif: ITMSStyle;
  tmsifex: ITMSStyleEx;
  I: Integer;
  for I := 0 to ControlCount - 1 do
    if (Controls[i].GetInterface(ITMSStyle, tmsif)) and not(Controls[i] is TAdvPanel)  then
    if (Controls[i].GetInterface(ITMSStyleEx, tmsifex)) and not(Controls[i] is TAdvPanel)  then
      tmsifex.SetComponentStyleAndAppColor(tsOffice2019Black, clNone);

Hi Gjalt

Thanks for the replay. Is there a chance to exclude certain components on the form control of AdvFormStyler? Other by bringing back my own style settings in code?
I'm trying to estimate how much work we would need to preserve out 'look & feel' settings.

Let me quote Bruno's response from the other thread regarding WebUpdate component and UAC control (also started by me).
"It is clear that any chance we consider needs to preserve backwards compatibility. We cannot afford to cause problems / unexpected behavior changes for the many other users who have come to expect the current behavior as default."
Please explain it to me how should I understand your definition of preservation of backwards compability. Sometimes it is considered and sometimes not?
I have to admit that I'm disappointed a little :frowning:

And let me ask - can you consider tsCustomStyle settings to exclude certain components from "Styler" affection? In reasonable future? Or I will have to deal with this "unexpected behavior changes" by myself? :frowning_face:


Hello Marcin,

Another way is to exclude it in the 'ApplyStyle' event of the TAdvFormStyler.

procedure TForm2.AdvFormStyler1ApplyStyle(Sender: TObject;
  AComponent: TComponent; var Allow: Boolean);
 if AComponent is TAdvPanel then
  Allow := false;

As I already mentioned this was a shortcoming in the TAdvPanel. The preservation of backwards compatibility is indeed very important to us, but we still need to fix bugs and solve deficiencies.
We are very sorry that you are disappointed by this, but unfortunately you were taking advantage of a flaw in our component.

The UIStyle and the use of tsCustom is already implemented in another way and changing this behavior to your question would cause unexpected behavior for a lot of other clients, as it is intended for the TAdvFormStyler to change all the supported components.

Hopefully the code given to you is a solution to your problem.

Kind regards,