Within my application's MainForm, I have 3 Stylebooks available for users to choose from. Once a selection is made, the same Stylebook is applied to other Forms within the program. While most of the styles are properly set, there is one toolbar that stubbornly retains its initial color.
I've experimented with two different methods to apply the Stylebook:
Method 1:
Directly from the individual Forms using the following code snippet:
Self.StyleBook := TForm(Application.MainForm).StyleBook;
Method 2:
Setting the Stylebook upon creation of the additional forms in the MainForm:
Form2 := TForm2.Create(nil);
Form2.StyleBook := Self.StyleBook;
Form2.Show;
Unfortunately, both approaches yielded the same outcome. The only workaround I found was manually adding the Stylebooks to each form in the designer, which is not an ideal solution.
Any suggestions on how to resolve this issue would be greatly appreciated.
UPDATE: It appears that the style color does update correctly after I rotate the screen.