SetGridRowColColor method (WinStudio scripts)

Applies To

IWSFormComponent interface, grid objects

Definition

Assigns background and foreground colors to specified grid cells. This method uses integers to specify the cell locations.

Syntax

object.SetGridRowColColor( integer1, integer2, string1, string2 )

  Part   Description
object Required. A reference to a grid object.
integer1 Required. Indicates the row number.

Row numbering is 1-based.

integer2 Required. Indicates the column number.

Column numbering is 1-based.

If you use 0 (zero) for this value, the colors are applied to the entire row.

string1 Required. A string containing the RGB code value of the color to be used for the background.
string2 Required. A string containing the RGB code value of the color to be used for the foreground.

Remarks

The background color is used for the background color of the designated cells. The term "foreground color" typically refers to the font/text color.

The RGB strings consist of a series of three comma-separated integers, each in the range 0-255. For example, the RGB code for a deep purple color might be rendered as (158,44,186).

The use of an empty (null) string ("") tells the system to use the default setting for that value.

Example

'The following code sets the background color to red 
'and resets the foreground color to the current WinStudio default.
ThisForm.Components("FormCollectionGrid").SetGridRowColColor(5, 1, "255,0,0", "")
Related topics