Hi list,

Did you ever want to dynamically change the background color (I need to stop 
and think in order to spell "colour" incorrectly) of a control to a custom 
color using a property command like PROPERTY <component ID> COLOR 'My Favourite 
Shade of Blue'?

Documentation says you can only user certain "described" colors like "BLUE", 
"SKY BLUE" or "NAVY". I can't find documentation to support the following, but 
it works:


1.       Go into the custom color dialog and note the RGB values;

2.       Calculate ColorValue = (B*256*256)+(G*256)+R;

3.       Use the value of ColorValue in the property command.

For example, we use a custom bluish colour for certain controls on a particular 
form under certain circumstances. The RGB values are 167, 180 and 237 
respectively. ColorValue works out to 15578729. (Black=0, White=16777215 which 
is one less than the number of bytes in 16MB).

Then, PROPERTY ExamID COLOR '15578729' makes the background color of the DBEdit 
control, ExamID, bluish!


Regards,

Stephen Markson
The Pharmacy Examining Board of Canada
416.979.2431 x251

Reply via email to