03-30-2015 05:04 AM
Hello !
I'm working on a simple serial terminal and I'd like to change the color of each line depending on if the message is sent or received. I have a string indicator in which I append all messages, sent or received.
My problem is that when I change the color of a substring using a property node, all the text of my string indicator changes. Here's a small VI that shows my problem (my actual VI is a bit too big to be put here but the string part works the same. I concatenate, keep the indices and apply the property node) :
Result :
Any idea on how I could change the color only of the new line ? It looks like the selection doesn't really work, since everything in the string takes the new color.
Thanks in advance,
Tim
PS : I saw a solution on the web in which the property node has to be extended for each line, obviously it doesn't work for me as the number of lines changes dynamically.
Solved! Go to Solution.
03-30-2015 05:47 AM - edited 03-30-2015 05:57 AM
The text size, colour, etc. apply to the entire string control, not specific parts of the text.
(EDIT - I stand corrected - thx Jim)
A severe omission (in my opinion) is the lack of a Rich Text control or HTML control native to Labview that text formatting can be applied to. However, you could add an active X browser control and format your text with html.
03-30-2015 05:49 AM
The problem you're going to have is that the string doesn't contain formatting information and the indicator doesn't retain it. You'll have to set the font.color in every line, every time you get a new message. See my post here - http://forums.ni.com/t5/LabVIEW/Different-fonts-in-string-indicator/m-p/1601602/highlight/true#M5823...
03-30-2015 05:55 AM
Thanks Jim, I'll try that. It looks slow, too bad NI doesn't manage this better. Some HTML balises would be so efficient and easy to implement 😕