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 window, Appearance category.

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 by default because the current XP theme controls the appearance of the button. Set the ShowBackColorOnXP property of the DataWindow object to force the color change to take effect.


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'");