You can change the field attributes of a UDF (such as text color, background color and bold) using the Set Field Attribute script.  This can be set up to change when an event occurs.

SetFieldAttribute 


void SetFieldAttribute(LPCTSTR fieldname, long textcolor, long backgroundcolor,  BOOL bold)


The SetFieldAttribute() method allows the field attributes to be set, such as text color, background color and bold.  Use the RGB(red,green,blue) macro to set the text color and background color.  The intensity for each argument is in the range 0 through 255.  If all three intensities are zero, the result is black.  If all three intensities are 255, the result is white.


NLSapp.SetFieldAttribute "CIF_DETAIL_UDF1", RGB(0,0,0), RGB(255,255,255), false


Below is the example that will set the text color to black and background color to red.

NLSapp.SetFieldAttribute "CIF_DETAIL_UDF12", RGB(0,0,0), RGB(255,0,0), false