02-22-2018 09:02 AM
Terrible title I know but I didn't know how to shorten it. So set say I have a string control with some text in it. If the text is too long it will wrap onto a new line which is great. But lets say I want to know what that text looks like in the control. I want to know how many lines are displayed, and what the text is, preferable with return characters inserted. Here is an image of how I would want the text to be returned:
The added kicker is I would like this to work on Linux RT hardware too. This means currently using a subset of UI properties and methods.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
Solved! Go to Solution.
02-22-2018 09:28 AM
Even with all the scripting/secret nodes enabled I dont see anything that would get you what you want..Have you considered using the get text rect function and manually figuring it out? Or do you need it exact?
02-22-2018 09:41 AM - edited 02-22-2018 09:44 AM
Okay, what about using the 'Get Nth' line method? Put it in a loop (loop index to index - the function returns an error when the line doesnt exist which you can use to stop the search)and you can build up what the string looks like from there.
02-22-2018 09:45 AM - edited 02-22-2018 09:50 AM
I don't know about all the other stuff you want but the Text.Text property will return the text and then the length can be determined the usual way, same for showing the control characters.
02-22-2018 10:16 AM
I once solved the inverse problem, making a String Control "fit" a single-line string, regardless of the String's Font settings, so I can make some suggestions:
Bob Schor
02-22-2018 01:00 PM - edited 02-22-2018 01:01 PM
K guys thanks, this was actually pretty easy. For some reason I didn't realize the Nth line string worked on the control, I figured it functioned the same as the Pick Line primitive. And bonus it does work on RT (at least my Linux RT with embedded UI enabled)
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord