LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change color of sub string text changing whole string

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. 

0 Kudos
Message 1 of 7
(3,166 Views)

You want Text.FontColor

!1.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 7
(3,146 Views)

I did use Text.FontColor.  The image is of the code segment that does the changing. I can provide more if needed.

0 Kudos
Message 3 of 7
(3,137 Views)

You forgot to add. The index of the end of the selection should be the sum of the two lengths.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 7
(3,134 Views)

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.

0 Kudos
Message 5 of 7
(3,118 Views)

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.

0 Kudos
Message 6 of 7
(3,095 Views)

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.

 

Sheet_001.jpg

0 Kudos
Message 7 of 7
(3,069 Views)