Is there something like a myControls collection?

I am interested in changing the styles (colors, fonts, etc…) of various controls (e.g. labels, textfields) on Open. Basically a poor man’s versions of CSS for a desktop app.

is there a collection of the Controls that exist in my design that can be referenced? I’d test the object type and then apply the appropriate formatting at run time.

Or, if there is better way to do this, I’m all ears.

Thanks,

You can iterate through all of a Windows’s controls and use IsA to work with them.

https://documentation.xojo.com/api/deprecated/window.html#window-controls

Another option is to subclass your controls and do the formatting in the subclass.

Exactly what I needed. Thank you.

1 Like