I've been wondering if this behavior is a bug or an intended feature and would like your opinion.
Personaly I think it's a bug... but I might be biased by the end result I'm trying to reach.
The issue is that when one uses String.TextSelction.Start and End properties to change the font of a string subset, it works as one should expect. But as soon as you append a string to it, the whole string text reverts to the font of the last property set instead of just adding the text at the end and keeping the fonts for the rest of the string. To better understand, try out the VI below. I've deliberately added a delay to allow for more dramatic effect...
I can see why this "bug", if it is one, would be tough to get rid of. It has implications in how a string constant/control/indicator works. For example, if the font color from index 7 to 14 is "blue" and I insert a string subset at index 10, then it should follow that the text I insert would be "blue" also.
The current workaround is to read the fonts of all characters in the string before appending/inserting and to rewrite each fonts after the operation, to restore the colored lines. It is nice when working on short strings, but imagine a log system with hundreds if not thousands of lines, all different colors for informations, alarms, data, etc. Even with panel update differing, it would be time-consuming...
Change line color LV85.vi 11.77K
339 downloads
Change line color LV86.vi 10.93K
325 downloads













