BackColor Inheritance
Back Color Inheritance - Controls
A control's background color at runtime depends on several factors:
Most controls, by default, are rendered so that any entry capable areas have a white backcolor, and non-entry capable areas are effectively transparent (there are some exceptions to this, notably the command button and container objects like the DataGrid, SmartNav and Tab controls).
For those controls that have a BackStyle property, this property will default to BackTransparent, and the control takes its background color from its parent object (usually the current form but this may also be another control such as a tab, smartnav or panel control. The following factors however, automatically change the default BackStyle property of a control to BackOpaque, which means the control will render with a solid background color (these items are evaluated in order):
- If the control's underlying host field is a reverse image field (in Identify, the field's Reverse attribute will be set to True), then the control's BackStyle will default to BackOpaque. This ensures that any reverse color mapping you have specified in Color Settings will be automatically applied to the control.
- If, in Color Settings, the category which the control belongs to has been mapped to a different background color than the Background category (i.e. the control's default backcolor is different to the global form backcolor), then the control will default to BackOpaque, to render the control in the specified category color.
- If the BackColor property is explicitly set (in Designer) then the BackStyle will automatically update to BackOpaque.
A control's BackColor is then determined by:
- If BackStyle is BackOpaque, the control will use its BackColor property value (if set). If BackColor is not set, it will derive its color from Color Settings.
- If BackStyle is BackTransparent, the control's BackColor property value is ignored and it will be rendered with the same background color as its parent.
Manually inserted controls behave as though they are host Green-on-Black (non-reverse) field, therefore they will use the corresponding graphical display settings mapped to these host colors.
Back Color Inheritance - Forms
The active runtime form derives its back color in the following manner:
- The default back color for all forms (including host, added, pop up and master forms) is derived from the value of App.BackColor.
- If the App.BackColor property is explicitly set within a macro or script (at anytime), then this value will take precedence as the back color for forms. If not explicitly set, App.BackColor defaults to the Background color mapped to Host Black in Color Settings.
- If your solution contains a master form, and the master form's BackColor property has been explicitly set but the content placeholder's Transparent property is False (default), then the runtime form loaded into the Content Placeholder will derive its back color from App.BackColor.
- If your solution contains a master form, and the master form's BackColor property has been explicitly set AND the content placeholder's Transparent property is True, then the runtime form loaded into the Content Placeholder will be transparent and the master form will become the form's background.
- If the BackColor property of the active form is explicitly set (either in Designer or via a macro or script) then the form will always render with this back color.
See Also
Display Settings | Color Settings
©
2004-2021 looksoftware.
All rights reserved.