Move cursor to specific location in a textarea

I am building a scripting app.

I have TextArea where the code is written. I am using a Listbox that has variables that when doubled clicked inserts the variable into the textarea at the selstart location.

The problem is that I need to move the cursor to the end of the inserted text.

Is there a way to do this?

After you’ve set SelText, change SelStart to the starting position + the length of the inserted text.

Too late Emile…