Color to use as the background of the object.
| HexColorNumber | RGBColor
|ColorName||Name of a web color or system color. For more information, see Standard Colors .|
|HexColorNumber|| Hexadecimal number (prefixed by a hash
mark) of a color. For example:
|RGB (Red Green Blue) numeric values in the
|Dynamic?||Yes for widgets, No for other objects|
|Supported in Grid?||Depends on widget|
|Dependencies:||Depends on widget. See Limitations|
Uniface follows Windows behavior in applying colors. Depending on the Windows version and the object, the color may not always be applied. For example, the color determined by the theme may take precedence over the foreground and background color values of widgets.
When set dynamically, all widgets accept the property, but some will ignore it. For example, the command button color cannot be changed.
For forms and application shells, this property is a static property that can only be set in ProcScript before the shell or component is displayed. For forms, use $windowproperties. For application shells, use $applproperties. For more information, see $windowproperties and $applproperties.
Setting in ProcScript
The BackColor property can be set dynamically in ProcScript for all objects except menus and panels. For menus and panels, color properties are set in the initialization file (usys.ini).
|Widgets||$fieldproperties||All widgets accept the property, but some will ignore it; for example, the Windows button color cannot be changed.|
|Forms||$windowproperties||BackColor has no effect if a background image is defined for the form.|
|Menus||N/A||BackColor can only be set in usys.ini.|
Caution: Do not combine the use of Uniface index colors with the Foreground and Background properties. This is not supported and can lead to unexpected results.
For example, if you have set the Foreground and Background colors, you should not use curoccvideo or fieldvideo because these statements set an index color. When the item loses focus, the color is restored to the default index color, not to the Foreground and Background colors.
In some circumstances, this property is not supported:
- Forms—property has no effect if a background image is defined for the form.
- Command Button—supported only when
Representation is set to
- Check Box—only supported for the label color, not the checkbox itself.
- Hyperlink—supported only when Transparency is switched off
- OCX Container—always overlapped by OCX control
- Radio Group—supported only for the labels and the label area.
Setting Widget Colors in ProcScript
The following code example builds a list of
vProperties) and assigns them to the widget of field FLD1:
putitem/id vProperties,"backcolor","lightskyblue" putitem/id vProperties,"forecolor","#000000" $entityproperties(FLD1)=vProperties
The widget now has a light blue background and black foreground (text).
- Application Shells
- Widgets for Dynamic Server Pages
- Menu Objects
- Area Frames and Lines
- udefentity (Default Entity Widget )
- ucheckbox (CheckBox)
- ucolorbox (ColorBox)
- ucolorlist (ColorList)
- ucombobox (Combo Box)
- udropdownlist (DropDownList)
- uhyperlink (Hyperlink)
- ulistbox (ListBox )
- umap (Map)
- umeter (Meter)
- (umonthcalendar) MonthCalendar
- uOcxContainer (OcxContainer)
- uOleContainer (OleContainer)
- uoutputbox (OutputBox)
- upicture (Picture)
- uradiogroup (RadioGroup)
- uslider (Slider)
- uspinbutton (SpinButton)
- utabex (TabEx)
- utree (Tree)