Method XbpWindow():setColorBG() Foundation

Sets or returns the background color

:setColorBG( [<nColor>] ) --> nOldColor
The #define constants from GRA.CH or XBP.CH must be used for <nColor>. These constants begin with either the prefix GRA_CLR_ or the prefix XBPSYSCLR_ . Alternatively, a RGB color value can be used to specify the background color, see function GraMakeRGBColor() for further info.

This method returns the previous color index of the background color (current before the method is called). If no new color index is specified, the method simply returns the current color index.


The method :setColorBG() sets the background color for an Xbase Part or returns the current color index. The default color is defined by the parent of an Xbase Part.

If the special color value XBPSYSCLR_TRANSPARENT is assigned as the background color for an Xbase Part, the areas normally rendered using the background color become translucent. This causes parts of the parent object to show through in those areas, and can be used to position Xbase Parts on a background bitmap. XBPSYSCLR_TRANSPARENT is supported by XbpSetting and its sub-classes, as well as by most Xbase Parts that display a bitmap.

The background color of XbpMenu, XbpMenuBar and XbpPushButton objects cannot be defined by an Xbase++ program. Instead, instances of these Xbase Part classes use system colors defined in Control Panel.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.