KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Setting the background color for a group of cells
PRODUCT: 4D View | VERSION: 2003 | PLATFORM: Mac & Win
Published On: July 10, 2003

If you want to use PV SET RANGE PROPERTY to assign a background color to three consecutive rows in one call, you will notice that the constants that define the property are broken down into odd and even rows (pv style color back even and pv style color back odd).

In order to keep your code simple, you may want to create your own method that takes care of the entire cell range at once:

C_LONGINT($1;$2;$3;$4;$5)
$area:=$1
$left:=$2
$top:=$3
$right:=$4
$bottom:=$5
PV SET RANGE PROPERTY ($1;$left;$top;$right;$bottom;pv style color back even ;PV RGB to color (0;0;125))
PV SET RANGE PROPERTY ($1;$left;$top;$right;$bottom;pv style color back odd ;PV RGB to color (0;0;125))