Pen.Style

Description

The style of the line or the outline of a graphic control.

In the painter

Pen Style on the General page in the Properties view.

Value

The only values that are supported on the Windows CE platform are:

Example

In this example, statements check the employee's start date to see if the month is the current month or the next month. Properties of a rectangle control placed behind the row of data are changed to highlight employees with months of hire that match the current month or the next month.

The Design view includes columns of data and a rectangle behind the data. The rectangle has been changed to black in the following picture to make it stand out.

Figure 23-15: Preview view of DataWindow with conditional pen style properties

The sample shows what the Design view looks like when properties of a rectangle control placed behind a row of data are changed to highlight an employee whose month of hire is the current month or the coming month. The rectangle behind the data is black.

The following statement is for the Pen.Color property of the line around the edge of the rectangle. If the month of the start date matches the current month or the next one, Pen.Color is set to light gray (12632256). If not, it is set to white (16777215), which means it will not show:

If(month( start_date ) = month(today())
or month( start_date ) = month(today())+1
or (month(today()) = 12 and month(start_date)=1),
12632256, 16777215)

The following statement is for the Pen.Style property of the rectangle. If the month of the start date matches the current month or the next one, Pen.Style is set to Solid (0). If not, it is set to NULL (5), which means it will not show:

If(month( start_date ) = month(today())
or month( start_date ) = month(today())+1
or (month(today()) = 12 and month(start_date)=1),
0, 5)