05-12-2014 01:50 PM
So I am trying to have certain text that is being displayed in a string indicator to be a different color that the rest but when the code is run it changes the color of all of the text instead of just the subset. I have attached an image of the code that changes the color. Any assistnace would be much apreciated.
05-12-2014 02:44 PM - edited 05-12-2014 02:44 PM
You want Text.FontColor
05-12-2014 02:49 PM
I did use Text.FontColor. The image is of the code segment that does the changing. I can provide more if needed.
05-12-2014 02:50 PM
You forgot to add. The index of the end of the selection should be the sum of the two lengths.
05-12-2014 03:17 PM
Thank you I did forget that though it has brought to light some behaviour that I find a bit odd. That behaviour is that when a strings text is changed, the whole string changes color to whatever was the last color set. This seems like counter intuitive behaviour to me. I have attached a small vi that shows what I am talking about.
05-12-2014 05:59 PM
It is strange to me that it became red since the last color you set was actually black.
But it does not surprise me that it became all one color. When you rewrite the data to the string, any formatting associated with portions of the previous string are now lost.
05-13-2014 02:08 AM
This is interesting, I modified bwaxler's code and came up an example which shows which section of the string is set to have the black colour at the very begining -- only the second line. You haveto run the program at least twice to see the effect.