B4J Question How can I programmatically scroll text

TomA

Active Member
Licensed User
Longtime User
I have been trying to find a way to scroll text automatically so info appended to the end is always shown without the user having to intervene so that when a line is added, the text scrolls to show it (think computer terminal). Can someone tell me how this might be done?
 

TomA

Active Member
Licensed User
Longtime User
Thanks Erel - works perfectly!
 
Upvote 0

wonder

Expert
Licensed User
Longtime User
B4X:
txtStatsBox.Text = txtStatsBox.Text & CRLF & ">> Status: Ready." & CRLF  
txtStatsBox.SetSelection(txtStatsBox.Text.Length, txtStatsBox.Text.Length)
This doesn't work for me... Even with Request Focus.
Any solution?
 
Upvote 0

saunwin

Active Member
Licensed User
Longtime User
Ummm .. funny Not working for me either

Sub lg(msg As String)
monitor.Text = monitor.Text & CRLF & msg
monitor.SetSelection(monitor.Text.Length, monitor.Text.Length)
End Sub

Do you get to the bottom of this ?
 
Upvote 0

saunwin

Active Member
Licensed User
Longtime User
Got it working now. I think it's because I was also writing to the text area from outside this subroutine. Do all text area writes using the subroutine works.
 
Upvote 0
Top