是否有任何創造性的方法來控制列錶框中特定項目的字體顏色?我知道如何將字體顏色發送到列錶框中的整個列表,但我很好奇是否可以將其應用於列表中的單個項目。
thx,DJ
如果在表格框中使用col框,則可以獲得不同的顏色。 看起來很相似 - 這是一個例子。
n1_list = [1, 2, 3, 4];
c1_list = {"XXX", "YYY", "ZZZ", "WWW"};
tb_list = {};
cb = col box("String1");
for (i = 1, i <= nitems(c1_list), i++,
tb_list[i] = text box(c1_list[i]);
cb << append(tb_list[i]);
);
// Change the color of the third item
tb_list[3] << font color("Red");
nw = new window("Test Color Listbox",
tb = table box(
number col box("Index", n1_list),
cb
)
);
tb << Set Selectable Rows(1);
tb << set row change function(
Function( {this},
row_list = this << get selected rows;
if (nrows(row_list) > 0,
one_row = row_list[1];
show(one_row, c1_list[one_row]);
);
);
);