¿Hay alguna forma creativa de controlar el color de la fuente en un elemento en particular dentro de un cuadro de lista? Sé cómo enviar el color de fuente a toda la lista dentro de un cuadro de lista, pero tenía curiosidad por saber si esto podría aplicarse a un solo elemento de la lista, por ejemplo.
gracias, DJ
Puede obtener diferentes colores si usa cuadros de columnas dentro de un cuadro de tabla. Parece similar, aquí hay un ejemplo.
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]);
);
);
);