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?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top