Background.property

Description

Settings for the color and transparency of a control.

Applies to

Button, Column, Computed Field, GroupBox, Line, Oval, Rectangle, RoundRectangle, and Text controls

Syntax

Describe and Modify argument:

"controlname.Background.property { = ' value ' }"

DataWindowSyntaxFromSql:

Column ( Background.property = value )
	Text ( Background.property = value )

Parameter

Description

controlname

The control whose Background properties you want to get or set.

When generating DataWindow syntax with DataWindowSyntaxFromSql, the Background settings apply to all columns or all text controls.

property

A property that applies to the background of a control, as listed in the Property table below.

value

Values for the properties are shown below. Value can be a quoted DataWindow expression.

Property for Background

Value

Color

(exp) A long expression specifying the color (the red, green, and blue values) to be used as the control’s background color.

Mode

(exp) A number expression specifying the mode of the background of controlname. Values are:

  • 0 – Make the control’s background opaque.

  • 1 – Make the control’s background transparent.

Usage


In the painter

Select the control and set the value in the Properties view, Font tab for controls that have text and in the General tab for drawing controls (choose Transparent or a color).

When you choose a Brush Hatch fill pattern other than Solid for an Oval, Rectangle, or RoundRectangle control, the Background Color and the Brush Color are used for the pattern colors.


Background color of a button

The Background.Color property is not supported on Windows XP because the current XP theme controls the appearance of the button.


Background color of a line

The background color of a line is the color that displays between the segments of the line when the pen style is not solid.


Transparent background

If Background.Mode is transparent (1), Background.Color is ignored.


DropDownDataWindows and GetChild

When you set Background.Color and Background.Mode for a column with a DropDownDataWindow, references to the DropDownDataWindow become invalid. Call GetChild again after changing these properties to obtain a valid reference.

Examples

Example 1

[Visual Basic]
Dim BGProperty As String
DW1.SetProperty("Oval2.Background.Color", "RGB(255, 0, 128)")
BGProperty = DW1.Describe("Oval2.Background.Color")
DW1.Modify("EmpName.Background.Color='11665407'")
BGProperty = DW1.Describe("EmpName.Background.Mode")
DW1.Modify("EmpName.Background.Mode='1'")
DW1.Modify("RndRect1.Background.Mode='0'")

[C#]
string BGProperty;
DW1.SetProperty("Oval2.Background.Color", "RGB(255, 0, 128)");
BGProperty = DW1.Describe("Oval2.Background.Color");
DW1.Modify("EmpName.Background.Color='11665407'");
BGProperty = DW1.Describe("EmpName.Background.Mode");
DW1.Modify("EmpName.Background.Mode='1'");
DW1.Modify("RndRect1.Background.Mode='0'");