7
votes

I have applied a style to a VCL application in Delphi XE2, but it works OK, but it seems that the main menu has ignored the style. See attached image. Is this a normal behavior?enter image description here

Any advice on how to apply style to the main menu?

1
See this comment. Rodrigo suggests there to use TActionMainMenuBar instead of TMainMenu. But he'll be soon or later here with the answer, I'd say :-)TLama

1 Answers

10
votes

This is a limitation of the TMainMenuBarStyleHook Vcl Style hook. The normal approach to fix this kind of issue is create and register new TMainMenu Style hook, but unfortunately this Vcl Style hook is used internally by the TFormStyleHook (the vcl style hook of the forms), so this will require which you create a new form style hook as well and this implies a lot of work.

So my suggestion is replace the TMainMenu for a TActionMainMenuBar component which works very well with the vcl styles.

enter image description here