Home > database >  How to change the data window one cell font color, be urgent!!!!!!
How to change the data window one cell font color, be urgent!!!!!!

Time:09-27

In the program, how to change a line of a column in the data window font color?
Please help me solve, thank you!

CodePudding user response:

Dw_1. Modify (" column names. Color='255')//set to red

CodePudding user response:

Datawindow selected in field/font/text color can write expressions satisfy conditions of display colors

CodePudding user response:

Change a column, or modify a field can be directly modify field properties to the font color -> textcolor

Statements dw_2. Object. Field. Color=RGB (0, 255)

To modify a row, can choose the bank all of the fields, and then set the color

If you need more, you can refer to the following example
Words or dynamically modify the cell background color, http://download.csdn.net/source/1672427

CodePudding user response:

//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
//function function: set a procession of color and write protect attribute
//call way: f_set_color (dw_1, row, col)
//protect the whole line: f_set_color (dw_1, row, 0)
//protect the whole column: f_set_color (dw_1, 0, col)
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The INTEGER li_i
STRING ls_str

Dw_setcolor. Setredraw (FALSE)
Background//reset
Dw_setcolor. Modify (" # "+ STRING (col) +". The background, mode=2 ")
Dw_setcolor. Modify (" # "+ STRING (col) +". The background. The color=16777215 ")


IF the row=0 THEN
//change a column color
Ls_str="#" + STRING (col) + ". The background. The color='536870912 ~ TRGB (230230230)') "
Dw_setcolor. Modify (ls_str)
Ls_str="#" + STRING (col) + ". Protect='1' "
Dw_setcolor. Modify (ls_str)
ELSEIF col=0 THEN
//change a line color
Dw_setcolor. Modify (" DataWindow. Detail. Color='1000 ~ tif (getrow ()="+ STRING (row) +", RGB (230230230), 536870912),' ")
FOR li_i=1 TO INTEGER (dw_setcolor. Object. The DataWindow. Column. Count)
Dw_setcolor. Modify (ls_str)
Dw_setcolor. Modify (" # "+ STRING (li_i) +". Protect='0 ~ tif (getrow ()="+ STRING (row) +", 1, 0)' ")
NEXT
The ELSE
//change the cell color
Ls_str="#" + STRING (col) + ". The background. The color='1000 ~ tif (getrow ()="+ STRING (row) +", RGB (230230230), 536870912) ", "
//messagebox (" ", ls_str)
Dw_setcolor. Modify (ls_str)
Dw_setcolor. Modify (" # "+ STRING (col) +". Protect='0 ~ tif (getrow ()="+ STRING (row) +", 1, 0)' ")

END the IF
Dw_setcolor. Setredraw (TRUE)

CodePudding user response:


If just change some the color of the cell, is only a line:
//change the cell color
Ls_str="#" + STRING (col) + ". The background. The color='1000 ~ tif (getrow ()="+ STRING (row) +", RGB (230230230), 536870912) ", "
//messagebox (" ", ls_str)
Dw_setcolor. Modify (ls_str)
Dw_setcolor. Modify (" # "+ STRING (col) +". Protect='0 ~ tif (getrow ()="+ STRING (row) +", 1, 0)' ")

Thank you very much!!

CodePudding user response:

The
reference 4 floor gloomybima reply:
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
//function function: set a procession of color and write protect attribute
//call way: f_set_color (dw_1, row, col)
//protect the whole line: f_set_color (dw_1, row, 0)
//protect the whole column: f_set_color (dw_1, 0, col)
//-- -- -- -- -- -- -- -- -- -- -...

To study the
  • Related