Description

Set the background color, foreground color, selected background color, and/or selected foreground color, for a specified cell in an edit table.

Applies to

Edit table.

Syntax

text = Send_Message(controlID, "COLOR_BY_POS", column, row, color_array)

Parameters

For COLOR_BY_POS, the Send_Message function has the following parameters.

ParameterDescription
column, rowWhen column and row are both positive, applies the color to the cell; when column is positive and row is 0, applies the color to the entire column; when column is 0 and row is positive applies the color to the entire row.
color_array

A field mark delimited array for setting the background color, foreground color, background color if selected, and foreground color if selected. The colors are set as follows:

Field NumberDescription
1Background color value
2Foreground color value
3Background color value, if the cell is selected
4Foreground color value, if the cell is selected

Note: When setting the color for column and row headings the text color is set. An array is not used to set the color in a column or row header. To set the color in a column or row heading just a single value is passed.

See also

COLORS $Insert recordFONT_BY_POS messageTEXT_BY_POS messageSTYLE_BY_POS message

Example

/* Set background color to yellow, foreground color to black, background color if cell is selected to green, and foreground color if cell is selected to red */
 
$insert colors
 
Declare function Send_Message
Back_color = YELLOW$
Fore_color =  BLACK$
Back_sel_color = GREEN$
Fore_sel_color = RED$
 
/* Set row 1, column 2 to desired color scheme */
rv = Send_Message(@Window:".TABLE_1", "COLOR_BY_POS", 2, 1, Back_color:@FM:Fore_color:@FM:Back_sel_color:@FM:Fore_sel_color)
 
/* Set all cells in column 2 to desired color scheme */
rv = Send_Message(@Window:".TABLE_1", "COLOR_BY_POS", 2, 0, Back_color:@FM:Fore_color:@FM:Back_sel_color:@FM:Fore_sel_color)
 
/*  Set all cells in row 7 to desired color scheme */
rv = Send_Message(@Window:".TABLE_1", "COLOR_BY_POS", 0, 7, Back_color:@FM:Fore_color:@FM:Back_sel_color:@FM:Fore_sel_color)
 
/* Set the color of the text for the first column header */
hdr_color = RED$
rv = Send_Message(@window:".TABLE_1","COLOR_BY_POS",1,-1,hdr_color)
 
/* Set the color of the text for the third row header */
hdr_color = GREEN$
rv = Send_Message(@window:".TABLE_1","COLOR_BY_POS",-1,3,hdr_color)
  • No labels