LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Different text color in string

Hi

I'm trying to make the text colour in a string variable depending its length.
It almost works but there's a little mistake of my part. But I can't find it!And the text should also be editable in the middle of it. Not just at its end.
Any help would be great.

Thanks
Yves


LV 8.2
0 Kudos
Message 1 of 5
(2,704 Views)

Wait, you want to chage the color based on the number of characters in the string, or the physical length on the screen? If you mean the number of characters, you're making things way too complicated. If you mean the actual size on the screen, it seems to work just fine for me. What exactly isn't working?

Also, the cursor goes to the end of the string all the time because the last thing you do in each iteration is set both the selection start and end to the length of the string.

Message Edited by Marc A on 03-07-2007 09:57 AM

0 Kudos
Message 2 of 5
(2,696 Views)
I want to change the colour of the "extra" characters.

And yes, I mean the actual size on the screen.

I know that the cursor always goes to the end of the string. If I don't do this the selection isn't removed. Is there another way to handle this?

Thanks for your help

Yves
0 Kudos
Message 3 of 5
(2,675 Views)
I found the problem you were running into. You needed to select the text->font->color property. The one you were using changes the color of the whole string. It's confusing, I know. I also cleaned it up a bit with an event structure and solved your other problem. I read the position before changing the color and set it back to that position again so you can insert text in the middle.
Message 4 of 5
(2,654 Views)
Thanks for your 5*-help.

yves
0 Kudos
Message 5 of 5
(2,628 Views)