SetGridRowColColorByColumnName Method (WinStudio Scripts)

Applies To

IWSFormComponent interface, grid objects

Definition

Assigns background and foreground colors to specified grid cells. This method uses an integer to identify the row number and the column name to identify the column location.

For more information about background and foreground colors, see the "Remarks" section.

Syntax

object.SetGridRowColColor( integer, string1, string2, string3 )

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

Row numbering is 1-based.

string1 Required. The name of the column component, as it is known in the WinStudio form metadata.
string2 Required. A string containing the RGB code value of the color to be used for the background.
string3 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


Sub Main()
   'The following code sets the background color to red 
   'and resets the foreground color to the current WinStudio default.
   ThisForm.Components("grid1").SetGridRowColColorByColumnName(5, "gridColumn1", "255,0,0", "")
End Sub
相关主题