Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use Color Scheme
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00437705
Message ID:
00437810
Views:
22
Ok, this might not be the best way to do it, but this will work.

(I just noticed the ColorScheme and ColorSource properties, and I realize that those might be easier and more efficient than my solution. But since I already typed this all, I'm posting it anyway :) )

Make a table with the following columns:

cObject (this is the object, like textbox, grid, form, etc.)
lForeColor (if .T., this is the forecolor, else it is the back color)
nColor (this is the RGB() value of the color you want)
cScheme (this is the scheme, like December, Valentine's Day, etc.)

When your app starts, load the values from the table into properties into your application object (or global variables if you don't have an app object). For example, the app starts up, and you have an oApp.TextBoxForeColor and you would load the nColor value into that property. Depending on what scheme you want to use, those are the color values you load on startup.

Then, all you need is for your base classes to point to the oApp properties instead of having a numeric value. For example, your textbox base class would have a ForeColor of "oApp.TextBoxForeColor" rather than "0,0,0".

This way, when the app starts, you load whatever colors you want, and all of your objects will use those colors.

Bill
Previous
Reply
Map
View

Click here to load this message in the networking platform