LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling Size to Text method prevents string value changes?

Solved!
Go to solution

I'm calling the "Size to Text" method with an Invoke Node on a string control each time a keypress event is flagged.

Oddly, the string control never changes size. Have I misunderstood the purpose of "Size to Text" method?

 

Secondly, if I turn off "Update while typing" attribute, the keypress event is still registered by the event case, but the content of the string is consistently returned to the original string content - it becomes impossible to update!? Why does this behaviour occur?

 

Attached is my demo vi. If you run this, and try changing the content, you'll see the string control does not resize to the text.

Turn off the 'Update while typing' attribute, and it goes all crazy!

 

Any suggestions on how to get this to resize to the string content whilst the user types?

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Download All
0 Kudos
Message 1 of 3
(2,528 Views)

Ok, I've answered the first part of the question by reading the help:

 

 

So I still need to find a way to resize the width of the control to the content text whilst the user types, and, less importantly, I still have no idea why the behaviour of the string control is to prevent content changes if Update While Typing is off. Can anyone help?

Message Edited by Thoric on 11-28-2008 10:54 AM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 2 of 3
(2,525 Views)
Solution
Accepted by topic author Thoric

OK, with a lot more searching, I found a (password protected -grrrr) NI subvi called Get Text Rect

It (almost) returns the correct bounding rectangle for a font-formatted single line of text. With a slight correction, it works well for the large font that I'm using.

Solution attached.

 

Thanks to anyone who's spending time trying to solve this for me! Smiley Happy

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Download All
0 Kudos
Message 3 of 3
(2,514 Views)