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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to move cursor in string indicator to last line

Hello,
i have a string indicator box with a lot of lines which is updated all the time. What property can i use so that the visivble scrollbar is always at the end so that i see the last line of the string indicator?
Thx for your help

0 Kudos
Message 1 of 6
(4,310 Views)
Use the text -> scroll position property. It takes an integer that represents the line number where you want to scroll. You can either figure out the number of lines, or I found you can also just wire some huge number to it and it will go to the end.
Message 2 of 6
(4,306 Views)
Thx for your fast answer. I  currently do it like this, but it is to slow if i count always hundreds of lines only to go to the end.
It is a  Logging-box which ads each 500ms a new line.
I thought that there is perhaps something more professional integrated in Labview because the scrollbar also knows when to change the style (the moving bar goes smaller when there are more lines).
I read in the forum that others users also had this problem/question >4 years ago.
best regards
J.
0 Kudos
Message 3 of 6
(4,300 Views)
I hope you limit the data in the string control and not let it append to it indefinitely.

André
Regards,
André (CLA, CLED)
0 Kudos
Message 4 of 6
(4,295 Views)
That's true as well. Your indicator should probably only show the last part of the log. Then just keep a running count of how many lines were added. Everytime you add a new line, set the scroll position to the counter. Once you reach the max, remove the first line, add a new one, and set the scroll position to that max value. You shouldn't have to count the number of lines every time you add one.
0 Kudos
Message 5 of 6
(4,289 Views)

I have sent 0xFFFFFFFF to the Text.ScrollPos attribute this works to always keep the bottom visible.  It also is fine for partially filled string boxes.

0 Kudos
Message 6 of 6
(3,621 Views)