首页 > 代码库 > PowerBuilder -- 变更某列的背景色

PowerBuilder -- 变更某列的背景色

记得把background.mode设置为2

li_col++

ls_col[li_col] = ls_fit_no

ls_column = ‘ col‘ + String(li_col)

ls_column_text = ls_column + ‘_t‘

li_col_len = Integer(Len(ls_fit_desc) * 60)

ls_color_expression = "0~tif( col" + String(li_col) + " = ‘1‘, rgb(0, 255, 0), rgb(255, 0, 0))" // rgb(230, 165, 25)

ls_modify = ls_modify + ls_column_text + ‘.text="‘ + ls_fit_desc + ‘" ‘ + ls_column_text + ‘.width="‘ + String(li_col_len) + ‘" ‘ + &

                 ls_column + ‘.width="‘ + String(li_col_len) + ‘" ‘ + ls_column + ‘.color="‘ + ls_color_expression + ‘" ‘ + &

                 ls_column + ‘.background.color="‘ + ls_color_expression + ‘" ‘ + ls_column + ‘.background.mode="2"

PowerBuilder -- 变更某列的背景色