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

PowerBuilder dot notation:

dw_control.Object.controlname.Background.property

Describe and Modify argument:

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

SyntaxFromSql:

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 SyntaxFromSql, 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

Brushmode

(exp) An integer indicating the type of "brush" to use for the gradient.

Values are:

Painter: Background tab, Gradient group (not available in RichText, Graph, or OLE DataWindow objects).

Color

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

Painter: Background tab

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

2 -- Make the control's background partially transparent

Transparency

(exp) An integer in the range 0 to 100, where 0 means that the column or control's primary background is opaque and 100 that it is completely transparent.

Painter: Background tab.

Gradient.Angle

(exp) An integer indicating the angle in degrees (values are 0 to 360) used to offset the color and transparency gradient. This property is used only when the column's or control's background.gradient.mode takes values of 3 or 4.

Painter: Background tab, Gradient group.

Gradient.Color

(exp) A long specifying the color (the red, green, and blue values) to be used as the column or control's secondary background color. The gradient defines transitions between the primary and secondary background colors.

Painter: Background tab, Gradient group.

Gradient.Focus

(exp) An integer in the range 0 to 100, specifying the distance (as a percentage) from the center where the background color is at its maximum. (For example, if the radial gradient is used and the value is set to 0, the color will be at the center of the background; if the value is set to 100, the color will be at the edges of the background.)

Painter: Background tab, Gradient group

Gradient.Repetition.Mode

(exp) Specifies the mode for determining the number of gradient transitions for the column's or control's background color and transparency.

Permitted values and their meanings are:

  • 0

    Gradient.repetition.count determines the number of gradient transitions

  • 1

    Gradient.repetition.length determines the number of gradient transitions

Painter: Background tab, Gradient group.

Gradient.Repetition.Count

(exp) An integer specifying the number of gradient transitions for background color and transparency. A value of 0 indicates 1 transition. A value of 3 indicates 4 transitions. This property is used only when the gradient.repetition.mode property for the column or control takes the value of 0 (by count).

Painter: Background tab, Gradient group.

Gradient.Repetition.Length

(exp) A long specifying the number of gradient transitions. This property is used only when the gradient.repetition.mode property for the column or control takes the value of 1 (by length). The units for the length that you assign for gradient transitions are set by the DataWindow object's Units property.

Painter: Background tab, Gradient group.

Gradient.Scale

(exp) An integer in the range 0 to 100 specifying the rate of transition to the gradient color (as a percentage).

Painter: Background tab, Gradient group

Gradient.Spread

(exp) An integer in the range 0 to 100 indicating the contribution of the second color to the blend (as a percentage).

Painter: Background tab, Gradient group

Gradient.Transparency

(exp) An integer in the range 0 to 100, where 0 means that the column or control's secondary (gradient) background is opaque and 100 that it is completely transparent. The gradient defines transitions between the primary and secondary transparency settings.

Painter: Background tab, Gradient group.


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 of a button will take effect only when the Windows classic style option is selected. Select "Enable Windows Classic Style in the IDE" in the System Options for this property to take effect when running the application from the IDE; and select "Windows classic style" in the project painter for this property to take effect when running the application executable.

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.

Background gradient properties

Background gradient and transparency properties do not apply to DataWindow objects with the RichText, Graph, or OLE presentation style, and do not apply to the Line control.

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

dw1.Object.oval_1.Background.Color = RGB(255, 0, 128)
ls_data = dw1.Describe("oval_1.Background.Color")
dw1.Modify("emp_name.Background.Color='11665407'")
ls_data = dw1.Describe("emp_name.Background.Mode")
dw1.Modify("emp_name.Background.Mode='1'")
dw1.Modify("rndrect_1.Background.Mode='0'")
SQLCA.SyntaxFromSQL(sql_syntax, &
   "Style(...) Column(Background.Mode=1 ...) ...", &
   ls_Errors)
SQLCA.SyntaxFromSQL(sql_syntax, &
  "Style(...) Column(Background.Color=11665407 ...)", &
  ls_Errors)