I would like to provide a way to set the appstyler.style setting via a combobox. That way the user would be able to control the look of all forms in the application.
I am aware of the ability to link a Formstyler to a combobox so that users can use the combobox to dynamically change the form's style. However, I have not be able to figure out a straightfoward way to have the combobox set the overall appstyle. Is there an easy way to do that? I tried setting the appstyle in the onchange event of the formstyler linkedto the combobox but that causes a crash, presumably due to something analogous to an infinite message loop between the formstyler and the appstyler.
As a workaround, in the OnShow handlers of all other forms I could set the formstyler,style property to the formstyler.style property of the formstyler linked to the combobox. This seems inelegant and I was wondering if there was a better way to do this.
p.s.,
I really like the styling capability and it is really helping me to spruce up a very tired-looking app.
Did you
1) Put the AdvAppStyler on a datamodule?
2) Did you connect the different AdvFormStyler components to this central AdvAppStyler?
3) Change the AdvAppStyler style then.
Some more info is also here:
Yes, I did what you listed and read the link you cited (as I mentioned above, " am aware of the ability to link a Formstyler to a combobox so that users can use the combobox to dynamically change the form's style.". That all works and I have no question about that.
The question was about how updating the appstyle based on a combobox linked to a formstyler. As you know, you can link a combobox to a formstyler and the combobox automatically displays the list of a available styles. When the user changes the combobox selection the formstyle changes to reflect the combobox. I would like to take this one step further and have the combobox selection also update the appstyle so that the user can select the style for entire application. I can't see anyway straightforward way to update the appstyle based on the combobox linked to the formstyler. I could probably do this in an Onidle handler but that seems rather round about. Is there a better way to do this?