BackColor

Applies to

Windows and most controls

Description

The BackColor property defines the color to be used for the background of an object. When you are defining the background color in a painter, some of the choices take their values from the current Windows color scheme or from custom colors. To add your own colors to the color drop-down list, select Design>Custom Colors before displaying the Properties view. You can also choose Transparent.

Usage


In a painter

StepsTo set the background color for a window, MonthCalendar control, or graph:

  1. Select a color from the BackColor drop-down list on the General page in the window’s or graph’s Properties view.

StepsTo set the background color for other controls:

  1. Select a color from the BackColor drop-down list on the Font tab page in the control’s Properties view.

StepsTo set the background color for text objects in graphs:

  1. Select the desired text object in the Text Object list box on the Text tab page of the graph control’s Properties view.

  2. Select a color from the BackColor drop-down list.


In scripts

The BackColor property takes a long (-2 to 16,777,215) that specifies the numerical value of the background color of windows and other objects. The BackColor value is a combination of values for the red, green, and blue components of the color.

If you do not know the long value for the color, choose Design>Custom Colors to determine the red, green, and blue values and then call the RGB function to specify the color in a script.

The following example sets yellow as the background color for a graph control:

gr_1.BackColor = RGB(255, 255, 0)

For text displayed in the graph, BackColor is a property of a text component, such as labels on an axis.

The following example sets background color to blue for text labels on the Category axis of the graph control:

gr_1.Category.LabelDispAttr.BackColor = RGB(0, 128, 255)