03-09-2010 09:01 AM
I have attached an example VI that shows that the text string formattting remains unchanged as long as the value doesnt change. The font colors and styles remain the same as they were programmed. Once the value is changed, the format of the text string object kind of loses its mind and starts underlining the entire text string.
Is there a reason for this and is there a way that you can maintain the text string font color and style while changing the value? I am needing some help on this arena...
03-09-2010 12:48 PM
Hi,
format is changing because you applied corrections to font for few characters only. It is applying changes in font only to the selected text....try without that option and see..font stays even though u change value
03-09-2010 12:54 PM
Thanks for the response but I need to select certain substrings and color them differently by each line of the string depending on system information that I get that needs to be displayed something like this.
Fault 1 OK
Fault 2 OK
Fault 3 Bad
Fault 4 OK
Comm Fault OK
System timeout Failed
Any ideas?
03-09-2010 02:52 PM
The text font that is first set becomes the default font for the whole string. When you first select characters 0 to 6 the red underline font settings become the active setting for the whole string. When you set New Value 1 the selected text (char 3 to 21) will be blue but all the characters that are not selected (0 to 2 and 21 to 32) will have the new font settings (red underline). Then, when you set New Value2 the new text will get the red underline default font setting.
Probably you will have to track what was selected or not and apply settings individually to all these string sections.
Ben64
03-09-2010 03:52 PM
I always get a little peeved when formatting text. What I have done for other attributes but have now adapted for color is to use tags <color>text</color> and borrow a little from the Bold Particular String.vi in vi.lib. This is done pretty quickly so it may not handle all use cases (don't nest, check spelling). If you want to change tags and/or add colors change the default value of the cluster array in Color String.vi.
Hope this helps. You use one string (you don't have to display it) to keep the raw data and just display it using these VIs.
P.S. No I have still not resolved my licensing issue. Argh.