Background Color Label

Started by Emiliano, May 28, 2014, 01:39:43 AM

Previous topic - Next topic

Emiliano

Hello,
I noticed that in some PCs (not all, maybe with different OS) the same project OpenDCL, displays the label disabled with dark gray background.
This makes the dialogue very bad.

I note that the setting 'background', all of the controls, is -24

See attached image.
How can I fix this annoying problem?


owenwengerd

Handling control backgrounds is very complicated, so it's possible this is a bug. It's also possible you're seeing the use of visual styles, which override the Windows default behaviors. Try setting the Use Visual Styles property to False for each control.

Emiliano

I remember seeing in the past, the property "visual styles", but now I can not find it in any control:-[

I noticed that the problem of background is very evident in the "palette", while in the Control Bar is almost acceptable.
See the attached images.

PS. Another thing that can be useful for certain the bug: I noticed that the difference in background is much more evident with the Windows theme (color scheme: light gray) compared with the standard theme; so it seems that the controls are not transparent

Emiliano

IMPORTANT:
I noticed that the problem of the background of the label in the Control Bar will only occur if set with Openstudio,
If in Openstudio the 'Enable' is True, and set it to False from code, the background is correct!

owenwengerd

Your observation is correct that the "transparent" background is not transparent in the optics sense. Instead, transparent background means "match the parent control's background".

Emiliano

Quote from: owenwengerd on May 29, 2014, 03:37:23 AM
Your observation is correct that the "transparent" background is not transparent in the optics sense. Instead, transparent background means "match the parent control's background".

Ok, but the control does not assume the background color of the control's parent; then this is a bug ?

owenwengerd

As I mentioned earlier, your visual styles overrides the background color. You haven't said whether you have Use Visual Style enabled, so I'm not sure whether it's a bug.

Emiliano

I think this is a bug because if I set the property Enabled = False from code, the background of the label does not change, and this is correct!
Instead, if I change the same property from Openstudio the background of the label becomes darker.

I have not activated the property "Use Visual Style" because it is not available for the Label.

I look forward to hearing from you about.
Thank you for your help.