In my application, i create a global variable for FontName, FontSize and FontColor. For each Label and TextField i set this 3 visual effects.
In my DesktopWindow I have to set these 3 properties for all fields (DesktopLabel and DesktopText). I created global variables and would like to know if I can apply these properties through some property in DesktopLabel and DesktopText without needing code. If I have 10 labels, I have to do it manually through code for each one of them. Below is the code I use. It would be simpler if it were a property that I set somewhere.
I think you will need to do it via code since you have the properties stored in global variables.
Try the attached project to see if it will accomplish what you want - it uses introspection to loop thru all labels on a window and changes their font properties.
For each ctl as object in Self.controls
Select case ctl
Case IsA DesktopTextControl
DesktopTextControl(ctl).FontName = FontNameDefault
DesktopTextControl(ctl).FontSize = FontSizeDefault
DesktopTextControl(ctl).TextColor = FontColorDefault
End Select
Next
If you really want to get creative, you could make a window subclass that does this for you automatically…
Add a class to the navigator
Change its super to DesktopWindow
Add Opening event
Right click the event and select Add Event Definition
Paste code above into the Opening event, followed by a line that says RaiseEvent Opening
Whenever you create a new window, set its super to the class you created above.