I'm doing some tests and I realized that, in case you want to use a different background color (see DISABLEDBACKCOLOR) for disabled fields (see ENABLED := ...), you must: first, set the parameter of background color and then the state of enabled/disabled.
This is and will be a rule or is it a mistake?
The problem is due to the fact that the background colors are applied when you enable or disable the field (take a look to control.prg, ENABLED method).
My opinion is that there are, and will be, other cases, but I think it is better to establish a rule rather than complicate the code. Team: what do you think about it?
This code work fine
Code: Select all
WITH OBJECT TextBox():New()
...
:DisabledBackColor := { 153, 255, 153}
:Enabled := .F.
...
END WITH
Code: Select all
WITH OBJECT TextBox():New()
...
:Enabled := .F.
:DisabledBackColor := { 153, 255, 153}
...
END WITH