Issue with VCL Styles for TAdvStringGrid on MDIChild form

C++ Builder Athens 12.1

We have a project where we were are using VCL Styles to create a 'night mode' for one of our projects. This project uses MDI forms, and there is a button on the main form to switch between 'Windows' and 'Carbon' themes. Switching to 'Carbon' works fine, but when switching back to 'Windows', TAdvStringGrids on MDI children forms retain the Carbon theming.

I was able to create a sample app that shows this behaviour.

image
image
image
StringGridNightModeTest.zip (2.8 MB)

Thanks,
Elias

Unfortunately, the parent control in this case is not sending the CM_STYLECHANGED message to our grid control.
A workaround for this shortcoming with MDI windows is to programmatically force a style update via calling

grid.StyleElements := [seFont, seClient, seBorder];

Thanks, Bruno. That works great.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.