Conditionally coloring an entry field 
Author Message
 Conditionally coloring an entry field

Hi,

Using CW 2.001 I am trying to colour the background of a total field
(DiffTot) at the bottom of a browse.   It should be pink when positive
and light green when negative.  The total field is a read-only entry
control.

The Help on PROP:Color says only:

PROP:Color   COLOR attribute. An array.

Well, assuming that the array has four LONGs, I did the following:

  ! set colour of total

  CLEAR(ColourArray[])
  IF DiffTot < 0
    ColourArray[1] = COLOR:Black
    ColourArray[2] = 080FF80H         ! light green background        
?DiffTot{PROP:Color} = ColourArray[]
  ELSIF DiffTot > 0
    ColourArray[1] = COLOR:Black
    ColourArray[2] = 08080FFH         ! pink background
    ?DiffTot{PROP:Color} = ColourArray[]
  .
  DISPLAY(?DiffTot)

Nothing happened.  Any suggestions would be most welcome.

TIA,  David Podger



Tue, 28 Dec 1999 03:00:00 GMT  
 Conditionally coloring an entry field

Confession time,

My two postings to comp.lang.clarion have turned out to be related.  
When I remove my attempt at colouring the background of an entry
control, hey presto, my Unknown Error Posted 10  GOES AWAY!

Still don't know how to do that colouring...

David Podger



Tue, 28 Dec 1999 03:00:00 GMT  
 Conditionally coloring an entry field

Try using the PROP:Color property syntax with the array element you want.
Example:

?EntryControl{PROP:Color,1} = COLOR:Black
?EntryControl{PROP:Color,2} = COLOR:White
?EntryControl{PROP:Color,3} = COLOR:Red
?EntryControl{PROP:Color,4} = COLOR:Black



Quote:
> Hi,

> Using CW 2.001 I am trying to colour the background of a total field
> (DiffTot) at the bottom of a browse.   It should be pink when positive
> and light green when negative.  The total field is a read-only entry
> control.



Fri, 31 Dec 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Disabling Field Lookup for a Conditionally disabled entry field

2. conditionally color one FIELD in a browse

3. colors in entry fields

4. CW 2.003 - Conditional Colors on an ENTRY field?

5. Disabled entry field colors

6. Conditionally Bolding Field on Report

7. Restricting certain character entry in an Entry field

8. validation of entry fields, keyboard navigation of entries

9. Change Entry Fields To String Fields.

10. Entry Field on non Key Field

11. conditional listbox entry color

12. Text coloring within an entry control?

 

 
Powered by phpBB® Forum Software