From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
Here is a real challenge I would say: Programmatically size a string indicator and/or the window size, such that it mimics the behaviour of the 'message' indicator of the One Button Dialog box.
This isn't difficult. You just have to find the right VIs to do it
Use the "Get Text Rect.vi" in picture.llb (in LV7.1). Depending on the
font and other parameters it'll return the size of the text in pixels.
Use this output to set the string indicator size (maybe adding a
constant) and the windows size (adding a constant).
Can't edit my thread
It seems adding 20 to horizontal and 12 to vertical size leads to good results when using a standard string control/indicator.
Just set the size property of the string control/indicator.
Thanks a lot Dan, I tried the Bounds property instead of the Size property. Bounds is read-only, Size can be set during run-time. The Get Text Rect.vi and related are very useful indeed.
Glad I could help. Yes there are indeed some very useful functions
hidden in the depth of the included libraries but not accessible
directly from the functions palette.