Home > database >  PB window control according to the numerical value according to different color!
PB window control according to the numerical value according to different color!

Time:10-03

//variable definition
String ls_mod, ls_err
Long ll_color1 ll_color2, ll_color3, ll_default_color
//set the SALARY column into the transparent mode
Ls_err=dw_salary. Modify (" salary. Background. The Mode=0 ")
If ls_err & lt; & gt;" "Then
Messagebox (" state ", "change background mode failure, error location:" + ls_err)
Return
End the if
//the SALARY column content points color display
/*
If SALSRY<2000, background is red
If SALSRY> 2000, but less than 3000, the background is blue
If SALSRY> 3000, but less than 4000, the background is green
The other is white
*/
Ll_color1=255//red
Ll_color2=16711680//blue
Ll_color3=65280//green
Ll_default_color=16777215//white
Ls_mod="Salary. Background. Color='" & amp;
+ String (ll_default_color) & amp;
+ "~ tIf (Salary<2000, "& amp;
+ String (ll_color1) & amp;
+ ", If (Salary<3000, "& amp;
+ String (ll_color2) & amp;
+ ", If (Salary<4000, "& amp;
+ String (ll_color3) & amp;
+ ", "& amp;
+ String (ll_default_color) & amp;
"+"))) '
Ls_err=dw_salary. Modify (ls_mod)
If ls_err & lt; & gt;" "Then
Messagebox (" state ", "change the background color of failure, error location:" + ls_err)
Return
End the if



Don't know where is wrong always hint I color failed!!

CodePudding user response:

First to you to set the fields of color set a default background color such as white
Or Salary. The Background. The color is not
The modify just modify existing, cannot automatically create no

CodePudding user response:

1 stick not back!

CodePudding user response:

Pass by, lz too stingy

CodePudding user response:


Ls_err=dw_salary. Modify (" salary. Background. The Mode=0 ")
Ls_mod="Salary. Background. Color='" & amp;
+ String (ll_default_color) & amp;
+ "~ tIf (Salary & lt; 2000, "& amp;
+ String (ll_color1) & amp;
+ ", If (Salary & lt; 3000, "& amp;
+ String (ll_color2) & amp;
+ ", If (Salary & lt; 4000, "& amp;
+ String (ll_color3) & amp;
+ ", "& amp;
+ String (ll_default_color) & amp;
"+"))) '

The two together, and try,
Give you a successful example:
Ls_modify +=ls_objectname + ". Color=~ "" + String (ll_font) +" - "" + ls_objectname +". The background, mode=~ "0 ~ + ls_objectname" "+". Background. The Color=~ "0 ~ ~ tif (mod (getrow (), 2)=1, RGB (255255255)," + String (ll_back) + ") ~ ""
  • Related