Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to defeat EditBox ReadOnly back color (Bad framework
Message
From
05/03/2010 15:33:10
 
 
To
05/03/2010 15:12:55
James Hansen
Canyon Country Consulting
Flagstaff, Arizona, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01452840
Message ID:
01452863
Views:
61
I was just looking at design time. I've just run each test form from the IDE and the results I see are exactly the same.

This is a base VFP EditBox on a base VFP .SCX-based form. I don't have the Editbox in any container, it's directly on the form.

Maybe it's an issue with your particular computer? Can you try on a different one? Or, maybe post some repro code?

>Al,
>
>Are you talking about design time? Everything looks fine at design time. My problem is at run time.
>
>It doesn't matter what colors I set for BackColor, ForeColor, DisabledBackColor or DisabledForeColor at design time, it picks it's own background color at run time. I suspect it gets it from the container, hence the fix. I don't particularly want to mess with juggling global themes. I just want to set the color for this one edit box the way I want it to be.
>
>...Jim
>
>>Maybe this is too obvious, but have you looked at the .DisabledBackColor and .DisabledForeColor of the editbox?
>>
>>I just did a quick test with a new form in VFP9 SP2 7423:
>>
>>- created a new blank form
>>- added an editbox. Initially, its background color was white (255,255,255), controlled by the .BackColor property
>>- set its .ReadOnly property to .T.. This caused its background color to change to the .DisabledBackColor value of 236,233,216 (default on my system)
>>- then manually set .DisabledBackColor to 255,255,255. The editbox's background color changed back to white, as expected.
>>
>>The results of my testing:
>>
>>.ReadOnly / .Enabled      Foreground Color      Background Color
>>--------------------      ----------------      ----------------
>>
>>.F. / .T.                 .ForeColor            .BackColor
>>
>>.T. / .T.                 .ForeColor            .DisabledBackColor
>>
>>.F. / .F.                 .DisabledForeColor    .DisabledBackColor
>>
>>.T. / .F.                 .DisabledForeColor    .DisabledBackColor 
>>
You may also need to experiment with _Screen.Themes or SYS( 2700 ).
>>
>>If you're using a VFP framework, it may have its own ideas about how to handle foreground/background colours of ReadOnly/Disabled controls. The old VFE 5.0/5.5 framework did this, it was tricky to override.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform