Placing cursor at end of last line in a textarea

I am using a textarea to display lines of text. As a line is added I want the user to see the last line added.
how is this acheived.

You may move the Cursor or insert the line at the top of the TextArea.

In both cases, TextArea&.SelectionStart is/can be the answer:
https://documentation.xojo.com/api/user_interface/desktop/desktoptextarea.html#desktoptextarea-selectionstart

Use VerticalScrollPosition and large Number to scroll to the last/highest Line and as @Emile_Schwarz wrote, SelectionStart to place the Cursor. :wink:

You can use SelectionStart / SelectionLength


Var tx As String 
Var tx_DerniereLigne As String 
Var sel_Debut As Integer 

tx = ""
For i As Integer = 0 To 50
  tx = tx + "Bonjour mes amis. "
Next 
TextArea1.Text = tx + EndOfLine 
sel_Debut = TextArea1.Text.Length 
tx_DerniereLigne = "Aujourd'hui il fait beau" 
TextArea1.Text =  TextArea1.Text + tx_DerniereLigne
  
TextArea1.SelectionStart = sel_Debut
TextArea1.SelectionLength = tx_DerniereLigne.Length
//