D
Dirk Goldgar
Mr. B said:This was a strang one.
I got curious and scanned this thread, and while I was mystified at first,
it seems to me that the behavior is actually to be expected. Even though
you have set the control as disabled at design time, when the
conditional-formatting expression evaluates to True, it applies *all* the
formatting attributes that part of the CF instruction. One of those is the
Enabled attribute, so if you don't set that attribute to False (disabled) in
the CF instruction, the application of the formatting attributes is going to
enable the control.
The same thing happens if, say, you set a control's FontWeight property to
Bold at design time, and then set up a conditional-formatting instruction to
set its ForeColor to Red under some conditions. If that instruction doesn't
also specify the Bold attribute, then when the necessary conditions are met,
the control will have its forecolor set to red all right, but it will no
longer be bolded.
I'd never noticed that before, because I never applied conditional
formatting to any control whose other properties were not defaults.