Declaration (see MWindow.h):
Specifies the default filling color for drawing. Initial value is clWhite.
Return type: MColor
The background color is the default color for the fillXXXX functions (the default filling style is always solid - no gradient).
This color can be changed to any other using setFillSettings, so the OnPaint can ignore the default setting altogether. However, when implementing OnPaint, it is recommended to use this property for all the filling colors when drawing the window elements. Of course, one filling color is usually insufficient, but you can use the color modifier functions (see MColor) to create different, but related colors for different elements and different states. For example, getBackColor()+25 can be used for the hot state, getBackColor()+clGray - for the disabled state, getBackColor()-40 - for an external border, and so on.
If OnPaint uses the BackColor and ForeColor properties extensively enough, the entire color theme of the window can be changed from outside, simply by changing these two properties, without overloading the OnPaint handler. All Elgrint windows indeed rely extensively on these properties.
- This property (like any other) should not be used during OnPaint - it has no direct effect on the graphics. Use setFillSettings instead
Let us know
Please Contact us to report any errors on this page, or to suggest any improvements.