03-11-2021 10:51 AM
Hello
I read serial port device communication outputs on a string indicator box.
As the string response is received, I append line feed character and display output.
User wants to see the latest text string as the last line in the string indicator.
For this I have wired text scroll position property node as -1
So the last line is always seen in the text indicator.
The vertical scroll bar is shown. When the text indicator is updating continuously, user also scrolls vertical scroll bar with mouse. So the text indicator should scroll up.
But the scroll comes to last line. It does not allow user to scroll up even if the mouse is held down.
If user uses mouse and scrolls up, then the indicator should allow to scroll up and display the previous line data.
If no mouse scroll action then last line should be shown.
I am using LabVIEW 2016 and also LabVIEW 2019
Please let me know.
Thank you
Solved! Go to Solution.
03-11-2021 11:21 AM - edited 03-11-2021 11:23 AM
Unfortunately, that's how it works. As long as you keep updating the box - which is "always", your code will set the cursor to the last line and append. The way I got around that is to use a listbox, instead. But that comes with its own problems (like word wrap).
03-11-2021 11:37 AM
Put in a small boolean that is a flag for "Autoscroll". The user can set it to false if he wants to scroll. Put the property node for scroll position in a case structure controlled by that boolean flag.
03-12-2021 02:45 AM
@RavensFan wrote:
Put in a small boolean that is a flag for "Autoscroll". The user can set it to false if he wants to scroll. Put the property node for scroll position in a case structure controlled by that boolean flag.
Well, that's just dumb.
ON MY PART! I didn't even think to use that property. Oh, well, I never claimed to be exceptionally bright. Just exceptionally lucky to have people on this forum brighter than me.
03-12-2021 03:30 AM
Try with this. Autoscroll is stopped when the mouse button is pressed and the pointer is in the indicator area. It's restarted when the mouse button is released or the mouse pointer goes outside the indicator area.
It may not be exactly what you want, but very near I think.
03-12-2021 04:23 AM
Thank you..
That works
03-12-2021 09:58 AM
This should do it for you.