CHAPTER 10 Highlighting Information in DataWindow Objects
DataWindow Designer User’s Guide 291
5 Click the button next to the Brush Color property on the General page.
6 In the Modify Expression dialog box, enter the following expression for
the Brush.Color property:
If(mod(getrow(),2 )=1, rgb(255, 255, 255 ), rgb(240,
240, 240 ))
The mod function takes the row number (getrow()), divides it by 2, then
returns the remainder. The remainder can be either 0 or 1. If the row
number is odd,
mod returns 1; if the row number is even, mod returns 0.
The expression
mod(getrow(),2)=1 distinguishes odd rows from even
rows.
The
rgb function specifies maximum amounts of red, green, and blue: rgb
(255, 255, 255)
. Specifying 255 for red, green, and blue results in the
color white.
If the row number is odd (the condition evaluates as true), the rectangle
displays as white. If the row number is even (the condition evaluates as
false), the rectangle displays as light gray (
rgb (240, 240, 240)).
Example 2: rotating controls
The following DataWindow object shows the column headers for Health
Insurance, Life Insurance, and Day Care rotated 45 degrees.
To rotate each of these three text controls:
1 Select one of the controls, then use Ctrl + click to select the other two
controls.
The Properties view changes to show the properties that are common to all
selected controls.